SeqGAN-PyTorch icon indicating copy to clipboard operation
SeqGAN-PyTorch copied to clipboard

Why do you use math.exp?

Open KazutoshiShinoda opened this issue 6 years ago • 2 comments

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.

KazutoshiShinoda avatar Jun 27 '18 07:06 KazutoshiShinoda

@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))'

ShengleiH avatar Aug 13 '18 02:08 ShengleiH

But total_loss / total_words seems weird since the discriminator loss is not related to the sequence length.

deepylt avatar Aug 25 '18 17:08 deepylt