fairseq icon indicating copy to clipboard operation
fairseq copied to clipboard

How can I rollout step by step

Open playma opened this issue 9 years ago • 3 comments

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"

screen shot 2017-10-30 at 2 37 41 pm

playma avatar Oct 30 '17 06:10 playma

Yes, you want to call SequenceGenerator.generate and put the model in eval mode before doing so.

michaelauli avatar Oct 31 '17 23:10 michaelauli

@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.

playma avatar Nov 01 '17 14:11 playma

Take a look how it is done in generate.py, you want to do something similar.

michaelauli avatar Nov 01 '17 16:11 michaelauli