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

Missing Classification loss in Discriminator for fake Images #129

Closed
arshagarwal opened this issue Sep 13, 2020 · 2 comments
Closed

Missing Classification loss in Discriminator for fake Images #129

arshagarwal opened this issue Sep 13, 2020 · 2 comments

Comments

@arshagarwal
Copy link

According to the following code (line 248-252 at solver.py), classification loss for fake images is not computed and hence backpropogated, is there any specific reason behind this or is it a possible bug?

# Compute loss with fake images.
            x_fake = self.G(x_real, c_trg)
            out_src, out_cls = self.D(x_fake.detach())
            d_loss_fake = torch.mean(out_src)

Any help is highly appreciated.

@segalon
Copy link

segalon commented Sep 22, 2020

To my understanding it is computed at line 281 at solver.py. Classification loss for fake images is a part of the generator objective, not of the discriminator.

@arshagarwal
Copy link
Author

@segalon
Thanks for replying, I think I understand this now. In-fact, I even tried the model by adding classification loss for fake images for the discriminator, and found that the results deprecated. I reckon this happens because if we employ classification loss on fake images our ground truth label is often wrong, especially in the beginning when fake images have really poor quality.

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