Skip to content

Instantly share code, notes, and snippets.

@Exoceus
Created November 15, 2019 04:12
Show Gist options
  • Save Exoceus/c879c4410f99e71461f881a23f58eeca to your computer and use it in GitHub Desktop.
Save Exoceus/c879c4410f99e71461f881a23f58eeca to your computer and use it in GitHub Desktop.
# 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
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