google / compare_gan

Compare GAN code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Interpolates is different from paper

dongrongliang opened this issue · comments

In penalty_lib.py line 75, interpolates = x + alpha * (x_fake - x). As for the Algorithm 1 of paper 'Improved Training of Wasserstein GANs', the interpolates equation is wrote as interpolates = alpha * x + (1-alpha)*x_fake. Are these two formulation equivalent? Or There were some tricks I missed.

Those two are equivalent.
You want to interpolate between x and x_fake and since alpha is a random variable in [0, 1] you might as well compute:
interpolates = (1 - alpha) * x + alpha * x_fake
= x - alpha * x + alpha * x_fake
= x + alpha * (x_fake - x)

Thanks for checking our code for bugs :)