Created
November 21, 2019 18:10
-
-
Save n0obcoder/6187ae23d455dd5c797d8fe9e1b7d4ab 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
| import torch.optim as optim | |
| from torch.optim import lr_scheduler | |
| # Now we define the Loss Function | |
| loss_fn = nn.CrossEntropyLoss() | |
| # Define the optimizer | |
| lr = 0.00001 | |
| optimizer = optim.Adam(filter(lambda p: p.requires_grad, model.parameters()), lr = lr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment