Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add Serialization for Optimizers and Gradients #815

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

nkoppel
Copy link
Contributor

@nkoppel nkoppel commented Jul 13, 2023

Adds SerializeWithModel trait to allow serializing Gradients and Optimizers to files. Resolves #785, but technically will not implement SaveToNpz/LoadForNpz for optimizers, because we need an extra model parameter to structure the serialization of Gradients.

TODO

  • Implement SerializeWithModel for Adam.
    • Implement TensorCollection for AdamConfig: Did this in a somewhat hacky way by converting the Option<WeightDecay> to an (u64, f64).
  • Implement SerializeWithModel for RMSprop.
  • Implement SerializeWithModel for Sgd.

@nkoppel nkoppel marked this pull request as draft July 13, 2023 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impl SaveToNpz for Optimizers
1 participant