We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
After comparing your code and your WGAN-GP paper, there seems to be a mismatch. When you perform the gradient penalty, you do the following:
differences = fake_data - real_data interpolates = real_data + (alpha*differences) gradients = tf.gradients(Discriminator(interpolates), [interpolates])[0] slopes = tf.sqrt(tf.reduce_sum(tf.square(gradients), reduction_indices=[1])) gradient_penalty = tf.reduce_mean((slopes-1.)**2) disc_cost += LAMBDA*gradient_penalty
while in the paper it seems that you are describing the following (note the differences in the first two lines):
differences = real_data - fake_data interpolates = fake_data + (alpha*differences) gradients = tf.gradients(Discriminator(interpolates), [interpolates])[0] slopes = tf.sqrt(tf.reduce_sum(tf.square(gradients), reduction_indices=[1])) gradient_penalty = tf.reduce_mean((slopes-1.)**2) disc_cost += LAMBDA*gradient_penalty
You are nevertheless still sampling from a line joining fake and real data, so it should not make much difference.
The text was updated successfully, but these errors were encountered:
The 1st case: interpolates = real + alpha*(fake-real) = (1-alpha)real + alphafake The 2nd case: interpolates = fake + alpha*(real-fake) = alpha * real + (1-alpha)*fake
The two results are equal since the variable alpha is random float number between 0 and 1.
I wish this helps.
Sorry, something went wrong.
No branches or pull requests
After comparing your code and your WGAN-GP paper, there seems to be a mismatch. When you perform the gradient penalty, you do the following:
while in the paper it seems that you are describing the following (note the differences in the first two lines):
You are nevertheless still sampling from a line joining fake and real data, so it should not make much difference.
The text was updated successfully, but these errors were encountered: