wiseodd / generative-models

Collection of generative models, e.g. GAN, VAE in Pytorch and Tensorflow.
http://wiseodd.github.io
The Unlicense
7.32k stars 2.04k forks source link

Different gradient penalty from the paper #31

Closed jiadingfang closed 7 years ago

jiadingfang commented 7 years ago

https://github.com/wiseodd/generative-models/blob/566ac2e95971ab55d65169e565b9d53023ccc113/GAN/improved_wasserstein_gan/wgan_gp_tensorflow.py#L89

Hi, Thanks for the code, but I found that the gradient penalty term is different from the paper and the code given by the author gradient_penalty = tf.reduce_mean((slopes-1.)**2) https://github.com/igul222/improved_wgan_training/blob/fa66c574a54c4916d27c55441d33753dcc78f6bc/gan_mnist.py#L147

However, your code still works well and produce good results. I don't know if you intentionally did it, or it's just a typo but fortunately make no mistakes?

Thanks

wiseodd commented 7 years ago

Hi, thanks for noticing it. It was a typo. You are more than welcome to submit a pull request for this.