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

About the Identity loss in cyclegan.py #59

Closed
LittleQuteSweetie opened this issue Jun 20, 2019 · 4 comments
Closed

About the Identity loss in cyclegan.py #59

LittleQuteSweetie opened this issue Jun 20, 2019 · 4 comments

Comments

@LittleQuteSweetie
Copy link

LittleQuteSweetie commented Jun 20, 2019

The source code of Identity loss is shown below:
loss_id_A = criterion_identity(G_BA(real_A), real_A)
loss_id_B = criterion_identity(G_AB(real_B), real_B)

This seems a little bit weird to me, maybe it should be:
loss_id_A = criterion_identity(G_AB(real_A), real_A)
loss_id_B = criterion_identity(G_BA(real_B), real_B)

@binli123
Copy link

I have the same concern.

@busekuz
Copy link

busekuz commented Aug 22, 2019

I think these issues from the original repo, especially the first one, might give you a better idea on what identity loss is.
1, 2

@IvanFei
Copy link

IvanFei commented Nov 4, 2019

G_BA: domain B -> domain A,
It wants to realize identity map, f(x) = x.
In this case, If the input of G_BA is image in domain A (not in domain B), the output of G_BA should be the same as image in domain A.

As is shown in the picture (below) -> L_TID
image

refer to Unsupervised Cross-Domain Image Generation
and Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks

detailed explanation: junyanz/pytorch-CycleGAN-and-pix2pix#322

@LittleQuteSweetie
Copy link
Author

@IvanFei @busekuz
Thanks for your answers!
They are very helpful, especially the picture; I think now I do understand the identity loss.

Best Regards,
LQS

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

4 participants