Implementing the REINFORCE algorithm for encoder-decoder model
I am trying to train theencoder-decodermodel (EncoderDecoderModel) using the REINFORCE algorithm. For that, I need to decode using the random sampling method (do_sample=True) and use thelogits. I can’t find a way to get thelogitsfor the sampled tokens as, in the training mode, the decoding used isgreedy_decoding. The way to apply random sampling is only through thegeneratemethod but I couldn’t find a way to get thelogitsand, also, it doesn’t store the gradients.Any workaround for it?
2022-03-14T20:22:14Z
Hi, did you find a way to do this?