Skip to content

Instantly share code, notes, and snippets.

@phsamuel
Last active February 9, 2023 04:19
Show Gist options
  • Save phsamuel/cd92e7f016b772593b51979283f5639b to your computer and use it in GitHub Desktop.
Save phsamuel/cd92e7f016b772593b51979283f5639b to your computer and use it in GitHub Desktop.
About optimization
Something seems to be wrong with torch.optim.SGD. Maybe I don't really understand the usage. I tried to replace
SGDMom_points = train_curve(lambda params: SGDMomentum(params, lr=10, momentum=0.9))
with
SGDMom_points = train_curve(lambda params: torch.optim.SGD(params, lr=10, momentum=0.9))
on https://pytorch-lightning.readthedocs.io/en/stable/notebooks/course_UvA-DL/03-initialization-and-optimization.html
but the result seem very different as shown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment