# gen-rs
[](https://github.com/agarret7/gen-rs)
[](https://crates.io/crates/gen-rs)
[](https://docs.rs/gen-rs)
[](https://github.com/agarret7/gen-rs/actions?query=branch%3Amain)
This is evolving software. Expect breaking API changes.
gen-rs is an experimental crate for probabilistic programming in Rust. gen-rs was inspired by [GenTL](https://github.com/OpenGen/GenTL/tree/main), but with Rust-native constructs.
It approximately* implements the Generative Function Interface [[GFI]](https://github.com/agarret7/gen-rs/blob/main/gen-rs/src/gfi.rs) as specified in the [Gen.jl whitepaper](https://dl.acm.org/doi/10.1145/3314221.3314642) and [Marco Cusumano-Towner's thesis](https://www.mct.dev/assets/mct-thesis.pdf). It provides several kinds of inference procedures built on this interface.
## Modeling
- Dynamically-typed `TrieFn` DSL
- Unfold Kernel Combinator
- [Example model implementations](https://github.com/agarret7/gen-rs/blob/main/gen-rs/tests/triefns)
## Inference Procedures
- Importance Sampling
- Proposal-based MCMC
- Particle Filtering
Generate visualizations to `visualizations` with:
```shell
python -m venv venv && source venv/bin/activate && pip install matplotlib
cargo test && python visualization/visualizer.py
```
## Disclaimer
(*) `gen-rs` does not exactly implement the GFI. More precisely, `gen-rs` does not implement _retdiff_ or _choice gradients_.