{"id":13743064,"url":"https://github.com/dirmeier/sbijax","last_synced_at":"2025-10-07T21:03:57.439Z","repository":{"id":184491869,"uuid":"550462210","full_name":"dirmeier/sbijax","owner":"dirmeier","description":"Simulation-based inference in JAX","archived":false,"fork":false,"pushed_at":"2025-04-12T11:04:01.000Z","size":26678,"stargazers_count":35,"open_issues_count":5,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-19T13:31:35.974Z","etag":null,"topics":["abc","approximate-bayesian-computation","normalizing-flows","python","simulation-based-inference","smc-abc"],"latest_commit_sha":null,"homepage":"https://sbijax.rtfd.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dirmeier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-12T20:09:38.000Z","updated_at":"2025-09-19T10:19:58.000Z","dependencies_parsed_at":"2024-02-14T17:27:23.724Z","dependency_job_id":"13e610d7-5de1-41da-bd09-17d648d8caed","html_url":"https://github.com/dirmeier/sbijax","commit_stats":null,"previous_names":["dirmeier/sbijax"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/dirmeier/sbijax","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirmeier%2Fsbijax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirmeier%2Fsbijax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirmeier%2Fsbijax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirmeier%2Fsbijax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dirmeier","download_url":"https://codeload.github.com/dirmeier/sbijax/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirmeier%2Fsbijax/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278846427,"owners_count":26056107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abc","approximate-bayesian-computation","normalizing-flows","python","simulation-based-inference","smc-abc"],"created_at":"2024-08-03T05:00:39.652Z","updated_at":"2025-10-07T21:03:57.409Z","avatar_url":"https://github.com/dirmeier.png","language":"Python","funding_links":[],"categories":["Code Packages and Benchmarks"],"sub_categories":[],"readme":"# sbijax \u003cimg src=\"https://raw.githubusercontent.com/dirmeier/sbijax/main/docs/_static/sticker.png\" align=\"right\" width=\"160px\"/\u003e\n\n[![active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![ci](https://github.com/dirmeier/sbijax/actions/workflows/ci.yaml/badge.svg)](https://github.com/dirmeier/sbijax/actions/workflows/ci.yaml)\n[![codecov](https://codecov.io/gh/dirmeier/sbijax/branch/main/graph/badge.svg?token=dn1xNBSalZ)](https://codecov.io/gh/dirmeier/sbijax)\n[![documentation](https://readthedocs.org/projects/sbijax/badge/?version=latest)](https://sbijax.readthedocs.io/en/latest/?badge=latest)\n[![version](https://img.shields.io/pypi/v/sbijax.svg?colorB=black\u0026style=flat)](https://pypi.org/project/sbijax/)\n\n\u003e Simulation-based inference in JAX\n\n## About\n\n``Sbijax`` is a Python library for neural simulation-based inference and\napproximate Bayesian computation using [JAX](https://github.com/google/jax).\nIt implements recent methods, such as *Simulated-annealing ABC*,\n*Surjective Neural Likelihood Estimation*, *Neural Approximate Sufficient Statistics*\nor *Consistency model posterior estimation*, as well as methods to compute model\ndiagnostics and for visualizing posterior distributions.\n\n\u003e [!CAUTION]\n\u003e ⚠️ As per the LICENSE file, there is no warranty whatsoever for this free software tool. If you discover bugs, please report them.\n\n## Examples\n\n`Sbijax` implements a slim object-oriented API with functional elements stemming from\nJAX. All a user needs to define is a prior model, a simulator function and an inferential algorithm.\nFor example, you can define a neural likelihood estimation method and generate posterior samples like this:\n\n```python\nfrom jax import numpy as jnp, random as jr\nfrom sbijax import NLE\nfrom sbijax.nn import make_maf\nfrom tensorflow_probability.substrates.jax import distributions as tfd\n\ndef prior_fn():\n    prior = tfd.JointDistributionNamed(dict(\n        theta=tfd.Normal(jnp.zeros(2), jnp.ones(2))\n    ), batch_ndims=0)\n    return prior\n\ndef simulator_fn(seed, theta):\n    p = tfd.Normal(jnp.zeros_like(theta[\"theta\"]), 0.1)\n    y = theta[\"theta\"] + p.sample(seed=seed)\n    return y\n\n\nfns = prior_fn, simulator_fn\nmodel = NLE(fns, make_maf(2))\n\ny_observed = jnp.array([-1.0, 1.0])\ndata, _ = model.simulate_data(jr.PRNGKey(1))\nparams, _ = model.fit(jr.PRNGKey(2), data=data)\nposterior, _ = model.sample_posterior(jr.PRNGKey(3), params, y_observed)\n```\n\nMore self-contained examples can be found in [examples](https://github.com/dirmeier/sbijax/tree/main/examples).\n\n## Documentation\n\nDocumentation can be found [here](https://sbijax.readthedocs.io/en/latest/).\n\n## Installation\n\nMake sure to have a working `JAX` installation. Depending whether you want to use CPU/GPU/TPU,\nplease follow [these instructions](https://github.com/google/jax#installation).\n\nTo install from PyPI, just call the following on the command line:\n\n```bash\npip install sbijax\n```\n\nTo install the latest GitHub \u003cRELEASE\u003e, use:\n\n```bash\npip install git+https://github.com/dirmeier/sbijax@\u003cRELEASE\u003e\n```\n\n## Contributing\n\nContributions in the form of pull requests are more than welcome. A good way to start is to check out issues labelled\n[good first issue](https://github.com/dirmeier/sbijax/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).\n\nIn order to contribute:\n\n1) Clone `sbijax` and install `hatch` via `pip install hatch`,\n2) create a new branch locally `git checkout -b feature/my-new-feature` or `git checkout -b issue/fixes-bug`,\n3) implement your contribution and ideally a test case,\n4) test it by calling `make tests`, `make lints` and `make format` on the (Unix) command line,\n5) submit a PR 🙂\n\n## Citing sbijax\n\nIf you find our work relevant to your research, please consider citing:\n\n```\n@article{dirmeier2024simulation,\n  title={Simulation-based inference with the Python Package sbijax},\n  author={Dirmeier, Simon and Ulzega, Simone and Mira, Antonietta and Albert, Carlo},\n  journal={arXiv preprint arXiv:2409.19435},\n  year={2024}\n}\n```\n\n## Acknowledgements\n\n\u003e [!NOTE]\n\u003e 📝 The API of the package is heavily inspired by the excellent Pytorch-based [`sbi`](https://github.com/sbi-dev/sbi) package.\n\n## Author\n\nSimon Dirmeier \u003ca href=\"mailto:sfyrbnd @ pm me\"\u003esfyrbnd @ pm me\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirmeier%2Fsbijax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirmeier%2Fsbijax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirmeier%2Fsbijax/lists"}