martinarjovsky / WassersteinGAN

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

Question about 'one' and 'mone' #41

Closed sz128 closed 7 years ago

sz128 commented 7 years ago

I just got confusion about the "one" and "mone" used in "backward()". The goal of discriminator "D" is to maximize the output of netD for real data, but minimize the output of netD for fake data (as I understand it). While "backward" and "optimizerD" are minimizing a loss function. Therefore, I think "errD_real.backward(one)" should be "errD_real.backward(mone)", and "errD_fake.backward(mone)" should be "errD_fake.backward(one)". That is my opinion. Could you give some explanations? Thank you!

darid commented 7 years ago

发自我的 iPhone

在 2017年5月7日,07:35,sz128 notifications@github.com 写道:

I just got confusion about the "one" and "mone" used in "backward()". The goal of discriminator "D" is to maximize the output of netD for real data, but minimize the output of netD for fake data (as I understand it). While "backward" and "optimizerD" are minimizing a loss function. Therefore, I think "errD_real.backward(one)" should be "errD_real.backward(mone)", and "errD_fake.backward(mone)" should be "errD_fake.backward(one)". That is my opinion. Could you give some explanations? Thank you!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

XavierLinNow commented 7 years ago

hi, @sz128 . I have the same questions. Have you figured it out?

martinarjovsky commented 7 years ago

See https://github.com/martinarjovsky/WassersteinGAN/issues/9

XavierLinNow commented 7 years ago

@martinarjovsky , thanks!