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 loss is right? #58

Open
Bingohong opened this issue May 20, 2018 · 2 comments
Open

wgan loss is right? #58

Bingohong opened this issue May 20, 2018 · 2 comments

Comments

@Bingohong
Copy link

D_loss = tf.reduce_mean(D_real) - tf.reduce_mean(D_fake)
G_loss = -tf.reduce_mean(D_fake)

in the code , you define the discriminator loss is :
D_loss = tf.reduce_mean(D_real) - tf.reduce_mean(D_fake)
however the generator loss is:
G_loss = - tf.reduce_mean(D_fake)
i think the G_loss maybe G_loss = tf.reduce_mean(D_fake), we should remove the negative sign。
according to the original paper algrithom, the loss following:

D_loss =  - tf.reduce_mean(D_real)  +  tf.reduce_mean(D_fake)
G_loss =  - tf.reduce_mean(D_fake)
@wiseodd
Copy link
Owner

wiseodd commented May 20, 2018

Hi, it is because in this line there is negative sign.

.minimize(-D_loss, var_list=theta_D))

Please do not close this issue as I'd like to keep this open, so other can see in the future.

@Mushoz
Copy link

Mushoz commented May 17, 2019

Any reason for specifying the loss like this, and minimizing the negative of this? These three options should all be equivalent, correct?:

  1. As currently implemented
  2. As suggested in the first post, to remove the minus sign in the generator loss, and to then let the both minimize the defined losses (without any minus signs)
  3. The loss as currently defined, but to let the discriminator maximize D_loss (without the minus).

Or are there any practical differences between these 3 options?

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

3 participants