Skip to content

Instantly share code, notes, and snippets.

@Lexie88rus
Created August 30, 2019 21:12
Show Gist options
  • Save Lexie88rus/56979290f9775dbeca8fb99956a27512 to your computer and use it in GitHub Desktop.
Save Lexie88rus/56979290f9775dbeca8fb99956a27512 to your computer and use it in GitHub Desktop.
Setup hyperparameters and training device
# setup learning rate and loss function
learning_rate = 0.005
criterion = nn.NLLLoss()
# device to use (GPU if available, CPU otherwise)
device = torch.device('cuda:0' if torch.cuda.is_available() else "cpu")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment