Open Hzzone opened 4 years ago
@Hzzone,
Thanks for the issue. You are right. We didn't much experiment with LS-GAN, although what we have isn't too different. Since (a - b)^2 = a^2 -2ab + b^2
; and expectation would be E[a^2] - 2E[ab] + E[b^2]
. Now, in our case, b=1, hence we only get (E[a^2] - 2E[a] + 1)
. The only missing term is E[a]
. So, because of the upper bound, the GAN should still train fine, but you are correct that this needs to be fixed. Would you please be kind to open a PR?
Thanks and cheers :beers:! @akanimax
There exists an apparent error in the implementation of LSGAN below.
https://github.com/akanimax/BBMSG-GAN/blob/da82aa2e8507d17801bd2134a4ae754335d716f5/sourcecode/MSG_GAN/Losses.py#L145
Right implementation:
reference equation 8 of [Least Squares Generative Adversarial Networks].