-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add transforming adaptation with normalizing flows #154
Conversation
a63377e
to
3f64e42
Compare
3f64e42
to
7b4dd2e
Compare
b0cc403
to
2c29e11
Compare
6c02cc7
to
db139d6
Compare
0e3aed9
to
9ba1cf5
Compare
9ba1cf5
to
09f0b3c
Compare
docs/nf-adapt.qmd
Outdated
original parameter space to a space where the posterior is closer to a standard | ||
normal distribution. The flow is trained during warmup. | ||
|
||
For more information about the algorithm, see the paper todo |
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.
Can this link be added?
|
||
Currently, a lot of time is spent on compiling various parts of the normalizing | ||
flow, and for small models this can take a large amount of the total time. | ||
Hopefully, we will be able to reduce this overhead in the future. |
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.
Can a recommendation be made as to the size of model that warrants consideration of using NF?
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.
This doesn't really depend on the size of the model.
If it is easy to sample, using a NF isn't worth it, but you can run it on small or large models.
compiled = nutpie.compile_pymc_model( | ||
model, backend="jax", gradient_backend="jax" | ||
) | ||
``` |
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.
Perhaps show how to use it via pm.sample
as well?
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.
You can't pass arguments about the normalizing flow through pm.sample right now...
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.
I added a small section in the pymc-usage notes about the pm.sample
api.
Closing this in favor of #180 |
Experimental new algorithm that uses a normalizing flow instead of a mass matrix.
Set up using pixi:
Gives a shell with an appropriate python setup.
Usage with pymc:
Usage with stan:
The optimization can be quite expensive computationally (but luckily doen't need any extra gradient evaluations). A GPU is very helpful here. (Jax should pick up a cuda device automatically)