Gen.jl
A general-purpose probabilistic programming system with programmable inference, embedded in Julia.
Features
- Multi-paradigm Bayesian inference via Sequential Monte Carlo, variational inference, MCMC, and more.
- Gradient-based training of generative models via parameter optimization, wake-sleep learning, etc.
- An expressive and intuitive modeling language for writing and composing probabilistic programs.
- Inference algorithms are programmable: Write custom proposals, variational families, MCMC kernels or SMC updates without worrying about the math.
- Support for Bayesian structure learning via involutive MCMC and SMCP³.
- Specialized modeling constructs that speed-up inference by supporting incremental computation.
- Well-defined APIs for implementing custom generative models, distributions, gradients, etc.
Installation
The Gen package can be installed with the Julia package manager. From the Julia REPL, type ]
to enter the Pkg REPL mode and then run:
add Gen
To install the latest development version, you may instead run:
add https://github.com/probcomp/Gen.jl.git
Gen can now be used in the Julia REPL, or at the top of a script:
using Gen
To test the installation locally, you can run the tests with:
using Pkg; Pkg.test("Gen")
Tutorials
Learn how to use Gen by following these tutorials:
- Getting Started: Linear Regression
- Introduction to Modeling in Gen
- Object Tracking with Sequential Monte Carlo
- Speeding Up Inference with the Static Modeling Language
- Checking the Inference Programs
- Learning Generative Functions
More tutorials can also be found on our website. Additional examples of Gen usage can be found in GenExamples.jl.
Questions and Contributions
If you have questions about using Gen.jl, feel free to open a discussion on GitHub. If you encounter a bug, please open an issue. We also welcome bug fixes and feature additions as pull requests. Please refer to our contribution guidelines for more details.
Supporting and Citing
Gen.jl is part of ongoing research at the MIT Probabilistic Computing Project. If you use Gen for your work, please consider citing us:
Gen: A General-Purpose Probabilistic Programming System with Programmable Inference. Cusumano-Towner, M. F.; Saad, F. A.; Lew, A.; and Mansinghka, V. K. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ‘19). (pdf) (bibtex)