I believe that D_fake and D_real used in both loss_G and loss_feat should be calculated in the "Train Generator" code block.
In the source code, D_fake is the result of netD with the latest parameter updates, while D_real is the result of netD with the previous parameter updates.
I believe that D_fake and D_real used in both loss_G and loss_feat should be calculated in the "Train Generator" code block. In the source code, D_fake is the result of netD with the latest parameter updates, while D_real is the result of netD with the previous parameter updates.