Skip to content

Instantly share code, notes, and snippets.

@edwardeasling
Last active March 29, 2019 05:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edwardeasling/94c122f618b2182dff71a14f7b5a0415 to your computer and use it in GitHub Desktop.
Save edwardeasling/94c122f618b2182dff71a14f7b5a0415 to your computer and use it in GitHub Desktop.
BP1 - 01
def one_batch(xb,yb):
pred = model(xb)
loss = loss_func(pred, yb)
loss.backward()
opt.step()
opt.zero_grad()
def fit():
for epoch in range(epochs):
for b in train_dl: one_batch(*b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment