Last active
July 30, 2020 09:05
-
-
Save MLWhiz/6ab63d45bc98aaf9c7c2888e45dfed5a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Initialize BCELoss function | |
| criterion = nn.BCELoss() | |
| # Create batch of latent vectors that we will use to visualize | |
| # the progression of the generator | |
| fixed_noise = torch.randn(64, nz, 1, 1, device=device) | |
| # Establish convention for real and fake labels during training | |
| real_label = 1. | |
| fake_label = 0. | |
| # Setup Adam optimizers for both G and D | |
| # Learning rate for optimizers | |
| lr = 0.0002 | |
| # Beta1 hyperparam for Adam optimizers | |
| beta1 = 0.5 | |
| optimizerD = optim.Adam(netD.parameters(), lr=lr, betas=(beta1, 0.999)) | |
| optimizerG = optim.Adam(netG.parameters(), lr=lr, betas=(beta1, 0.999)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment