WassersteinGAN icon indicating copy to clipboard operation
WassersteinGAN copied to clipboard

Problems with the optimization of loss.

Open XJTUDog opened this issue 6 years ago • 4 comments

For WGAN, it should maximize the loss of Discriminator, and minimize the loss of negative Generator. However, it did just in the opposite way in the codes. am I wrong? I think it should like this: errD_real.backward(mone) in 189. errD_fake.backward(one) in 197. errG.backward(mone) in 213.

XJTUDog avatar Sep 10 '18 14:09 XJTUDog

The same confusion here. I think the code should be wrong.

chenzhekl avatar Oct 24 '18 12:10 chenzhekl

maybe check #9 and then #5.

merlinyx avatar Nov 08 '18 17:11 merlinyx

errD_real.backward(mone) in 189. errD_fake.backward(one) in 197. errG.backward(mone) in 213.

I think you are wright , however the code is also right . There are many ways to implement the loss function .

feixiangdekaka avatar Apr 10 '19 07:04 feixiangdekaka

In fact, I think two version of implements are right. Because the sigmoid function was not applied follow the critic, so the outputs of critic can be positive or negative. What we should do is making sure the generator and critic has opposite sign.

Kaede93 avatar Jul 25 '20 15:07 Kaede93