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

Question about GAN code: update the generator while training the discriminator #80

Open
wangchaozheng opened this issue Aug 1, 2019 · 2 comments

Comments

@wangchaozheng
Copy link

Through reading ur code, I think you update the generator while training the discriminator. We should detach it while training the discriminator, right?

@MorvanZhou
Copy link
Owner

MorvanZhou commented Aug 2, 2019

https://github.com/MorvanZhou/PyTorch-Tutorial/blob/master/tutorial-contents/406_GAN.py#L52-L53

opt_D = torch.optim.Adam(D.parameters(), lr=LR_D)
opt_G = torch.optim.Adam(G.parameters(), lr=LR_G)

This will update G and D separately.

@wangchaozheng
Copy link
Author

Thanks man, I understand now. I got confused by comparing ur code with the DCGAN tutorial on pytorch website. Thanks again!

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

2 participants