Created
June 8, 2019 19:59
-
-
Save vaibhavkumar049/54d6cf071325671b9e0650b46ce08cd2 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
def fit_v2(x, y, model, opt, loss_fn, epochs = 1000): | |
for epoch in range(epochs): | |
loss = loss_fn(model(x), y) | |
loss.backward() | |
opt.step() | |
opt.zero_grad() | |
return loss.item() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment