tntrung / gan

Tensorflow code of Dist-GAN, GN-GAN and other GAN methods
GNU General Public License v3.0
66 stars 21 forks source link

gradient penalty computation #2

Open sungwoong opened 6 years ago

sungwoong commented 6 years ago

Hi, Ngoc-Trung,

Thanks for your code sharing. I have a question regarding a computation of gradient penalty in your code.

In gaan.py, epsilon = tf.random_uniform(shape=tf.shape(self.X), minval=0., maxval=1.)

I think for the convex combination for each sample (same epsilon should be applied to all dims in each sample), epsilon = tf.random_uniform(shape=[tf.shape(self.X)[0],1], minval=0., maxval=1.)

Is it correct?

Thanks, Sungwoong.

tntrung commented 6 years ago

Hi Sungwoong, Yes, thanks for letting me know. I've fixed my bug. Best, Trung