Pytorch-cyclegan-and-pix2pix: Freezing the discriminator

Created on 20 Jul 2018  路  4Comments  路  Source: junyanz/pytorch-CycleGAN-and-pix2pix

I've been wondering, why don't you freeze the discriminators weights while using it in the generator loss calculation?

Most helpful comment

If you detach the output of D, G cannot get gradients. We did calculate the gradients for D, but we didn't update the D's weights.

All 4 comments

We did freeze the D's weights when calculating the G loss. Only G's weights got updated. See this line.

But for example, in this line: self.loss_G_A = self.criterionGAN(self.netD_A(self.fake_B), True) you don't detach the output of the discriminator and by that the loss can back-propagate to it. Isn't it?

If you detach the output of D, G cannot get gradients. We did calculate the gradients for D, but we didn't update the D's weights.

You're right! I feel so stupid right now lol

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zerxon picture zerxon  路  4Comments

HectorAnadon picture HectorAnadon  路  4Comments

AllAwake picture AllAwake  路  5Comments

shivom9713 picture shivom9713  路  4Comments

bill0812 picture bill0812  路  3Comments