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

Difference between paper and code in obtaining perturbed inputs #6

Closed
Netzeband opened this issue Feb 20, 2018 · 1 comment
Closed

Comments

@Netzeband
Copy link

In your paper (page 6. equation 1), you calculate the gradient penalty in this way:

grafik

So it looks like you simply add pixelwise Gaussian Noise with mean 0 and standard-deviation c to the inputs of the discriminator. Furthermore you suggest to use c = 10

However, in your code, you you calculate the perturbed inputs in this way:

def get_perturbed_batch(minibatch):
    return minibatch + 0.5 * minibatch.std() * np.random.random(minibatch.shape)

So here you add pixelwise uniform noise from the interval [0.0, 0.5 * minibatch.std() ), which is very different to the formulation of noise in the paper. Furthermore your code still contains the interpolation issue from https://github.com//issues/5

Of course you wrote "We use small pixel-level noise but it is possible to find better ways of imposing this penalty. However, this exploration is beyond the scope of our paper." But maybe there are important reasons why you use this type of X_p generation in the code?

@kodalinaveen3
Copy link
Owner

The code is really old, and we updated our paper with a simple clean version of the penalty later. If you notice the old one, we were basically setting 'c' automatically based on std() of the pixel values. In the new one, we leave them as hyperparameters

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