-
Notifications
You must be signed in to change notification settings - Fork 246
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
Support for mutable params #1016
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fehiepsi, could you provide some documentation somewhere (maybe in the numpyro.param
docstring?) to explain what mutable params are and why they might be useful? I'm struggling to imagine a use case from the interface alone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your patience and for explaining the code!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I hav reviewed general design and skimmed code. I have not meticulously reviewed all logic (e.g. destructured assignment) and assume tests will catch type errors.
Close #990.
This PR introduces an additional
mutable_state
field in SVIState, which stores parameters marked byinfer={"mutable": True}
. Those parameters will be skipped in the optimizer and it is the job of the model/guide to update them, e.g.numpyro.mutable