fairseq
fairseq copied to clipboard
How can I rollout step by step
Can I reuse the code in sequence_generator.py to rollout the target step by step for RL?
I want to reproduce the code in "Improving Neural Machine Translation with Conditional Sequence Generative Adversarial Nets"

Yes, you want to call SequenceGenerator.generate and put the model in eval mode before doing so.
@michaelauli Thank you for your reply. I have some problem. How can I give some sequence and rollout the whole sequence? e.g. translate.generate('I') and get I am happy.
Take a look how it is done in generate.py, you want to do something similar.