LantaoYu / SeqGAN

Implementation of Sequence Generative Adversarial Nets with Policy Gradient
2.08k stars 711 forks source link

Monte-Carlo roll-out #39

Closed WangWenshan closed 6 years ago

WangWenshan commented 6 years ago

Hi, Thank you for your job. I have question that how to process variable sequences in MC rollout? Thanks

eduOS commented 6 years ago

I am wondering what you meant by "to process variable sequences in MC rollout"?

WangWenshan commented 6 years ago

Sequences do not always have the same length. You can see Figure 1 in the paper (https://arxiv.org/abs/1612.00370)

eduOS commented 6 years ago

I think it is the same as that in generating the outputs while training the decoder, since when you calculate the loss you will mask out the tokens from the stop_token(you can add this) until the end of the sentence. The same applies to the roll-out, that is, when you work out the gan loss you will mask out the unnecessary tokens at the end of each sentence. As you can see in this line, the same lengths are reached for every sentence.

WangWenshan commented 6 years ago

Thanks