Bayesian Inference with JAX
Project description
Bayinx: Bayesian Inference with JAX
The endgoal of this project is to build a Bayesian inference library that is similar in feel to Stan(where you can define a probabilistic model with syntax that is similar to how you would write it out on a chalkboard) but allows for arbitrary models(e.g., ones with discrete parameters) and offers a suite of "machinery" to fit the model; this means I want to expand upon Stan's existing toolbox of methods for estimation(point optimization, variational methods, MCMC) while keeping everything performant(hence using JAX).
In the short-term, I'm going to focus on:
- Implementing as much machinery as I feel is enough.
- Figuring out how to design the
Modelsuperclass to have something like thetransformed pars {}block but unifies transformations and constraints. - Figuring out how to design the library to automatically recognize what kind of machinery is amenable to a given probabilistic model.
In the long-term, I'm going to focus on:
- How to get
Stan-like declarative syntax in Python with minimal syntactic overhead(to get as close as possible to statements likeX ~ Normal(mu, 1)), while also allowing users to work withtargetdirectly when needed(same asStandoes). - How to make working with the posterior as easy as possible.
- That's a vague goal but practically it means how to easily evaluate statements like $P(\theta \in [-1, 1] | \mathcal{D}, \mathcal{M})$, or set up contrasts and evaluate $P(\mu_1 - \mu_2 > 0 | \mathcal{D}, \mathcal{M})$, or simulate the posterior predictive to generate plots, etc.
Although this is somewhat separate from the goals of the project, if this does pan out how I'm invisioning it I'd like an R formula-like syntax to shorten model construction in scenarios where the model is just a GLMM or similar(think brms).
Additionally, when I get around to it I'd like the package documentation to also include theoretical and implementation details for all machinery implemented(with overthinking boxes because I do like that design from McElreath's book).
TODO
- Find some way to discern between models with all floating-point parameters and weirder models with integer parameters. Useful for restricting variational methods like
MeanFieldtoModels that only have floating-point parameters. - Look into adaptively tuning ADAM hyperparameters.
- Control variates for meanfield VI? Look at https://proceedings.mlr.press/v33/ranganath14.html more closely.
- Low-rank affine flow?
- https://arxiv.org/pdf/1803.05649 implement sylvester flows.
- Learn how to generate documentation lol.
- Figure out how to make transform_pars for flows such that there is no performance loss. Noticing some weird behaviour when adding constraints.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bayinx-0.3.15.tar.gz.
File metadata
- Download URL: bayinx-0.3.15.tar.gz
- Upload date:
- Size: 40.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac70eebdb1b09b2be952eda9c4538fcf348098490c62d8ff43381da8847416a3
|
|
| MD5 |
7d894cd141b47c13ddc633a555ded31f
|
|
| BLAKE2b-256 |
ab73f31162ec54499ae77d76767aee6efcad8ac3bbb51447536f118caafb0a41
|
File details
Details for the file bayinx-0.3.15-py3-none-any.whl.
File metadata
- Download URL: bayinx-0.3.15-py3-none-any.whl
- Upload date:
- Size: 25.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bed988f50e6e0f79dfdbeb1486840e585a7a963a798f78fd44aaecbc98747e8
|
|
| MD5 |
8e62e3b6ca15ec8f2b39380fa42968e6
|
|
| BLAKE2b-256 |
b9bfb053288ecad0234ad17f7f5f340dfd99e604372778bbf8e582d17671d222
|