Skip to content

Instantly share code, notes, and snippets.

@bilal2vec
Created February 26, 2020 21:00
Show Gist options
  • Select an option

  • Save bilal2vec/30981747e186c406ea9c3213df9eb510 to your computer and use it in GitHub Desktop.

Select an option

Save bilal2vec/30981747e186c406ea9c3213df9eb510 to your computer and use it in GitHub Desktop.
optimizer = torch.optim.SGD(model.parameters(), lr=0.1, momentum=0.9)
scheduler = torch.optim.CyclicMomentum(optimizer)
data_loader = torch.utils.data.DataLoader(...)
for epoch in range(10):
for batch in data_loader:
scheduler.batch_step()
train_batch(...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment