Skip to content

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

Open

Description

@wangchaozheng

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

Activity

  1. MorvanZhou commented on Aug 2, 2019

    @MorvanZhou
    Owner

    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.

  2. wangchaozheng commented on Aug 2, 2019

    @wangchaozheng
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions