hwalsuklee / tensorflow-generative-model-collections

Collection of generative models in Tensorflow
Apache License 2.0
3.91k stars 857 forks source link

Fix bug in computing gradient penalty #22

Open yang-song opened 6 years ago

yang-song commented 6 years ago

This is a shameful bug... Obviously the part I edited was copied directly from the Github repo of improved training for Wasserstein GANs. However, in the author's code, the image was first flatten to a matrix, that's why the reduction axis was only for [1]. In this implementation, we should use reduction axis [1, 2, 3] because we don't flatten images.