SeqGAN-PyTorch
SeqGAN-PyTorch copied to clipboard
Why do you use math.exp?
https://github.com/ZiJianZhao/SeqGAN-PyTorch/blob/master/main.py#L87
why?
In the original implementation by LantaoYu, exp is not used for loss values.
@shinochin hello, because 'NLLLoss' is used which is 'NLLLoss(x) = log(softmax(x))'. Therefore, to get the softmax results, you need to do this: 'softmax(x) = exp(NLLLoss(x))'
But total_loss / total_words
seems weird since the discriminator loss is not related to the sequence length.