Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WGAN-GP update formula wrong? #67

Open
Imperssonator opened this issue Mar 8, 2018 · 2 comments
Open

WGAN-GP update formula wrong? #67

Imperssonator opened this issue Mar 8, 2018 · 2 comments

Comments

@Imperssonator
Copy link

Imperssonator commented Mar 8, 2018

Line 76 of train_wgan_GP:
X_hat = X_real + epsilon * (X_fake - X_real)

From the paper this should be (Algorithm 1 Line 6):
X_hat = epsilon * X_real + ( 1 - epsilon ) * X_fake

In the format you used above:
X_hat = X_fake + epsilon * (X_real - X_fake)

In other words, X_hat should be a small nudging of X_fake toward X_real, not a small nudging of X_real toward X_fake...

Let me know if I'm missing something or if there's a reason it was done this way.

@Imperssonator
Copy link
Author

Looks like somebody else raised this issue before and it was closed, but the problem is still there.

@sarthmit
Copy link

@Imperssonator I think both the lines are equivalent.
Notice that since epsilon is drawn from a uniform distribution, you can equivalently replace epsilon by (1-epsilon), both of these expressions would be equivalent.
Now note that if you replace epsilon by (1-epsilon) in the paper's definition, you would get the one in the code. So both are correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants