Created
September 21, 2020 17:22
-
-
Save lucabergamini/8883bcb707d3c62fd5626e41e4c35d0f to your computer and use it in GitHub Desktop.
This file contains 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
optimizer = optim.Adam(model.parameters(), lr=1e-3) | |
criterion = nn.MSELoss(reduction="none") | |
outputs = model(torch.from_numpy(img)).reshape(translations.shape) | |
loss = criterion(outputs, translations) | |
optimizer.zero_grad() | |
loss.backward() | |
optimizer.step() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment