Created
August 31, 2019 14:14
-
-
Save omarsar/e7a7606bb8054093e8e559788c4a2ed7 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
learning_rate = 0.001 | |
num_epochs = 5 | |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") | |
model = MyModel() | |
model = model.to(device) | |
criterion = nn.CrossEntropyLoss() | |
optimizer = torch.optim.Adam(model.parameters(), lr=learning_rate) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment