ZiJianZhao / SeqGAN-PyTorch

A implementation of SeqGAN in PyTorch, following the implementation in tensorflow.
260 stars 93 forks source link

Why are you adding zero to your data and target? #16

Open ElroyLR opened 1 year ago

ElroyLR commented 1 year ago

Hello, I have run your code, and I noticed that when you pretrain the generator, you prepend a zero matrix to the data and append a zero matrix to the target. I wonder what is the purpose of this operation, and how it affects the NLL loss calculation. Also, in your adversarial training, when you use policy gradient for the generator, you still add zeros, but this time, you only replace the first element of the data (which is called ‘input’ in your function) with zero. Could you please explain these for me? Thankyou. looking forward to your reply.