Created
November 28, 2021 07:13
-
-
Save danielcwq/35f03c46e4661bec2ada80659927c149 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
#in pseudocode, this would be: | |
w -= gradient(w) *lr | |
#stepping learning function here | |
#converting this into a function: | |
def train_epoch(model, lr, params): | |
for xb,yb in dl: | |
calc_grad(xb, yb, model) | |
for p in params: | |
p.data -= p.grad*lr | |
p.grad.zero_() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment