https://github.com/qazalbash/jaxampler
An open-source JAX-based statistical sampling toolkit ๐งช
https://github.com/qazalbash/jaxampler
jax sampling sampling-distribution sampling-methods
Last synced: about 1 month ago
JSON representation
An open-source JAX-based statistical sampling toolkit ๐งช
- Host: GitHub
- URL: https://github.com/qazalbash/jaxampler
- Owner: Qazalbash
- License: apache-2.0
- Created: 2023-12-11T04:27:17.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-08T21:14:49.000Z (over 1 year ago)
- Last Synced: 2025-09-04T17:14:31.357Z (6 months ago)
- Topics: jax, sampling, sampling-distribution, sampling-methods
- Language: Python
- Homepage:
- Size: 1.45 MB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.bib
Awesome Lists containing this project
README
# Jaxampler ๐งช - A JAX-based statistical sampling toolkit
[](https://github.com/Qazalbash/jaxampler/actions/workflows/python-package.yml)
[](https://github.com/Qazalbash/jaxampler/actions/workflows/python-publish.yml)
[](https://github.com/Qazalbash/jaxampler/actions/workflows/github-code-scanning/codeql)

[](https://pypi.org/project/jaxampler/)
> [!IMPORTANT]
> ๐ฃ **As of April 2024 I recommends that new projects should adopt
> [NumPyro](https://github.com/pyro-ppl/numpyro) instead of Jaxampler.** ๐ฃ
>
> At the time of writing [NumPyro](https://github.com/pyro-ppl/numpyro) has a [larger](https://github.com/pyro-ppl/numpyro/graphs/contributors) and
> [more active](https://github.com/pyro-ppl/numpyro/activity) development team and
> more adoption with users. It has
> [more extensive documentation](https://num.pyro.ai/en/stable/index.html),
> [examples](https://github.com/pyro-ppl/numpyro/tree/master/examples)
> and an [active community](https://forum.pyro.ai/) creating end
> to end examples.
>
> Jaxampler will be a public archive but I have no plans to take it down from
> PyPI public repositories.
Jaxampler ๐งช is a statistical sampling toolkit built on top of JAX. It provides a set of high-performance sampling
algorithms for a wide range of statistical distributions. Jaxampler is designed to be easy to use and integrate with
existing JAX workflows. It is also designed to be extensible, allowing users to easily add new sampling algorithms and
statistical distributions.
Jaxampler is currently in the early stages of development and is not yet ready for production use. However, we welcome
contributions from the community to help us improve the library. If you are interested in contributing, please refer to
our [contribution guidelines](CONTRIBUTING.md).
## Features
- ๐ **High-Performance Sampling**: Leverage the power of JAX for high-speed, accurate sampling.
- ๐งฉ **Versatile Algorithms**: A wide range of sampling methods to suit various applications.
- ๐ **Easy Integration**: Seamlessly integrates with existing JAX workflows.
## Install
You may install the latest released version of Jaxampler through pip by doing
```bash
pip3 install --upgrade jaxampler
```
You may install the bleeding edge version by cloning this repo or doing
```bash
pip3 install --upgrade git+https://github.com/Qazalbash/jaxampler
```
If you would like to take advantage of CUDA, you will additionally need to install a specific version of JAX by doing
```bash
pip install --upgrade "jax[cuda12_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
```
## Requirements
Jaxampler requires Python 3.10 or later. It also requires the following packages:
```bash
jax>=0.4.0
jaxlib>=0.4.0
typing_extensions>=4.5.0
jaxtyping>=0.2.24
matplotlib>=3.8.0
tfp-nightly
tqdm
```
The test suite is based on `pytest`. To run the tests, one needs to install pytest and run `pytest` at the root
directory of this repo.
## Algorithms and Distributions
Jaxampler currently supports the following algorithms and distributions:
Monte Carlo Methods
- [ ] Hamiltonian Monte Carlo
- [x] Importance Sampling
- [ ] Metropolis Adjusted Langevin Algorithm
- [x] Monte Carlo Box Integration
- [x] Monte Carlo Integration
- [ ] Multiple-Try Metropolis
- [ ] Sequential Monte Carlo
- [ ] Variational Inference
- [ ] Wang-Landau Sampling
- [ ] Worm Algorithm
Samplers
- [x] Accept-Rejection Sampler
- [x] Adaptive Accept-Rejection Sampler
- [ ] Gibbs Sampler
- [x] Hastings Sampler
- [x] Inverse Transform Sampler
- [x] Metropolis-Hastings Sampler
- [ ] Slice Sampler
Random Variables
- [x] Bernoulli
- [x] Beta
- [x] Binomial
- [x] Boltzmann
- [x] Cauchy
- [x] Chi
- [x] Exponential
- [x] Gamma
- [x] Geometric
- [ ] Gumbel
- [ ] Laplace
- [x] Log Normal
- [x] Logistic
- [ ] Multivariate Normal
- [x] Normal
- [x] Pareto
- [x] Poisson
- [ ] Rademacher
- [x] Rayleigh
- [x] Student t
- [x] Triangular
- [x] Truncated Normal
- [x] Truncated Power Law
- [x] Uniform
- [x] Weibull
## Citing Jaxampler
To cite this repository:
```bibtex
@software{jaxampler2023github,
author = {Meesum Qazalbash},
title = {{Jaxampler}: tool for sampling statistical distributions},
url = {https://github.com/Qazalbash/jaxampler},
version = {0.0.7},
year = {2023}
}
```
## Contributors