Closed LittleQuteSweetie closed 4 years ago
I have the same concern.
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
refer to Unsupervised Cross-Domain Image Generation and Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks
detailed explanation: https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/issues/322
@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
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)