martinarjovsky / WassersteinGAN

BSD 3-Clause "New" or "Revised" License
3.2k stars 725 forks source link

Why there is no netG.parameters.requires_grad = False when updating netD? #42

Closed fungtion closed 7 years ago

fungtion commented 7 years ago

I'm new to the GAN, what I understand about it is that netG and netD should be optimized alternatively,but I cannot find netG.parameters.requires_grad = False when updating netD, I get confused about it.

kunrenzhilu commented 7 years ago

You freeze the netG when train netD

fungtion commented 7 years ago

@kunrenzhilu I see, setting Variable volatile=True means netG.parameters.requires_grad = False