martinarjovsky / WassersteinGAN

BSD 3-Clause "New" or "Revised" License
3.2k stars 725 forks source link

Problems with the optimization of loss. #61

Open XJTUDog opened 5 years ago

XJTUDog commented 5 years ago

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.

chenzhekl commented 5 years ago

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

merlinyx commented 5 years ago

maybe check #9 and then #5.

feixiangdekaka commented 5 years ago

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 .

Kaede93 commented 4 years ago

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.