Open XJTUDog opened 5 years ago
The same confusion here. I think the code should be wrong.
maybe check #9 and then #5.
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 .
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.
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.