{"id":13476845,"url":"https://github.com/undark-lab/swyft","last_synced_at":"2025-11-17T02:01:33.084Z","repository":{"id":37708514,"uuid":"266882295","full_name":"undark-lab/swyft","owner":"undark-lab","description":"A system for scientific simulation-based inference at scale.","archived":false,"fork":false,"pushed_at":"2024-03-30T06:19:33.000Z","size":398954,"stargazers_count":164,"open_issues_count":20,"forks_count":17,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-11-12T11:03:50.404Z","etag":null,"topics":["likelihood-free-inference","machine-learning","marginal-neural-ratio-estimation","neural-ratio-estimation","parameter-estimation","python","pytorch","simulation-based-inference","truncated-neural-ratio-estimation"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/undark-lab.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.md","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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-25T21:19:48.000Z","updated_at":"2025-05-20T17:26:57.000Z","dependencies_parsed_at":"2024-01-23T09:56:06.234Z","dependency_job_id":"8e71a852-7ae0-468a-8e6a-5c484c6e6349","html_url":"https://github.com/undark-lab/swyft","commit_stats":{"total_commits":1079,"total_committers":18,"mean_commits":59.94444444444444,"dds":0.4856348470806302,"last_synced_commit":"06cc0857a5768b97ec5c3c15aa94989a96b55600"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/undark-lab/swyft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undark-lab%2Fswyft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undark-lab%2Fswyft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undark-lab%2Fswyft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undark-lab%2Fswyft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/undark-lab","download_url":"https://codeload.github.com/undark-lab/swyft/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undark-lab%2Fswyft/sbom","scorecard":{"id":909223,"data":{"date":"2025-08-11","repo":{"name":"github.com/undark-lab/swyft","commit":"24b94bbbeb96663136b213839b2588d74569e6da"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Code-Review","score":1,"reason":"Found 5/30 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/pypi-publish.yml:1","Warn: no topLevel permission defined: .github/workflows/syntax.yml:1","Warn: no topLevel permission defined: .github/workflows/tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pypi-publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/undark-lab/swyft/pypi-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pypi-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/undark-lab/swyft/pypi-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/syntax.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/undark-lab/swyft/syntax.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/syntax.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/undark-lab/swyft/syntax.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/undark-lab/swyft/tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/undark-lab/swyft/tests.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/undark-lab/swyft/tests.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/pypi-publish.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/pypi-publish.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/syntax.yml:31","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:30","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:31","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   9 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T18:29:38.188Z","repository_id":37708514,"created_at":"2025-08-24T18:29:38.188Z","updated_at":"2025-08-24T18:29:38.188Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284021765,"owners_count":26933981,"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-11-12T02:00:06.336Z","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":["likelihood-free-inference","machine-learning","marginal-neural-ratio-estimation","neural-ratio-estimation","parameter-estimation","python","pytorch","simulation-based-inference","truncated-neural-ratio-estimation"],"created_at":"2024-07-31T16:01:35.273Z","updated_at":"2025-11-17T02:01:33.046Z","avatar_url":"https://github.com/undark-lab.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook","Code Packages and Benchmarks"],"sub_categories":[],"readme":"Swyft\n=====\n\n.. image:: https://raw.githubusercontent.com/undark-lab/swyft/v0.4.1/docs/source/_static/img/swyft_logo_wide.png\n   :width: 800\n   :align: center\n\n*Swyft* is a system for scientific simulation-based inference at scale.\n\n.. image:: https://badge.fury.io/py/swyft.svg\n   :target: https://badge.fury.io/py/swyft\n   :alt: PyPI version\n\n\n.. .. image:: https://github.com/undark-lab/swyft/actions/workflows/tests.yml/badge.svg\n..    :target: https://github.com/undark-lab/swyft/actions\n..    :alt: Tests\n\n\n.. .. image:: https://github.com/undark-lab/swyft/actions/workflows/syntax.yml/badge.svg\n..    :target: https://github.com/undark-lab/swyft/actions\n..    :alt: Syntax\n\n\n.. image:: https://codecov.io/gh/undark-lab/swyft/branch/master/graph/badge.svg?token=E253LRJWWE\n   :target: https://codecov.io/gh/undark-lab/swyft\n   :alt: codecov\n\n\n.. .. image:: https://readthedocs.org/projects/swyft/badge/?version=latest\n..    :target: https://swyft.readthedocs.io/en/latest/?badge=latest\n..    :alt: Documentation Status\n\n\n.. .. image:: https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat\n..    :target: https://github.com/undark-lab/swyft/blob/master/CONTRIBUTING.md\n..    :alt: Contributions welcome\n\n\n.. .. image:: https://colab.research.google.com/assets/colab-badge.svg\n..    :target: https://colab.research.google.com/github/undark-lab/swyft/blob/master/notebooks/Quickstart.ipynb\n..    :alt: colab\n\n\n.. image:: https://joss.theoj.org/papers/10.21105/joss.04205/status.svg\n   :target: https://doi.org/10.21105/joss.04205\n\n\n.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.5752734.svg\n   :target: https://doi.org/10.5281/zenodo.5752734\n\n\n*Swyft* is the official implementation of Truncated Marginal Neural Ratio Estimation (TMNRE),\na hyper-efficient, simulation-based inference technique for complex data and expensive simulators.\n\n\nSwyft in action\n---------------\n\n\n.. image:: https://raw.githubusercontent.com/undark-lab/swyft/v0.4.1/docs/source/_static/img/SBI-curve.gif\n   :width: 800\n   :align: center\n\n\n\n* Swyft makes it convenient to perform Bayesian or Frequentist inference of hundreds, thousands or millions of parameter posteriors by constructing optimal data summaries. \n* To this end, Swyft estimates likelihood-to-evidence ratios for arbitrary marginal posteriors; they typically require fewer simulations than the corresponding joint.\n* Swyft performs targeted inference by prior truncation, combining simulation efficiency with empirical testability.\n* Swyft is based on stochastic simulators, which map parameters stochastically to observational data. Swyft makes it convenient to define such simulators as graphical models.\n* In scientific settings, a cost-benefit analysis often favors approximating the posterior marginality; *swyft* provides this functionality.\n* The package additionally implements our prior truncation technique, routines to empirically test results by estimating the expected coverage, and a simulator manager with `zarr \u003chttps://zarr.readthedocs.io/en/stable/\u003e`_ storage to simplify use with complex simulators.\n\n\nPapers using Swyft/TMNRE\n------------------------\n\n2021\n\n- “Fast and Credible Likelihood-Free Cosmology with Truncated Marginal Neural Ratio Estimation“ Cole+ https://arxiv.org/abs/2111.08030\n\n2022\n\n- “Estimating the warm dark matter mass from strong lensing images with truncated marginal neural ratio estimation” Anau Montel+, https://arxiv.org/abs/2205.09126\n- “SICRET: Supernova Ia Cosmology with truncated marginal neural Ratio EsTimation” Karchev+ https://arxiv.org/abs/2209.06733\n- “One never walks alone: the effect of the perturber population on subhalo measurements in strong gravitational lenses” Coogan+ https://arxiv.org/abs/2209.09918\n- “Detection is truncation: studying source populations with truncated marginal neural ratio estimation” Anau Montel+ https://arxiv.org/abs/2211.04291\n\n2023\n\n- “Debiasing Standard Siren Inference of the Hubble Constant with Marginal Neural Ratio Estimation” Gagnon-Hartman+ https://arxiv.org/abs/2301.05241\n- “Constraining the X-ray heating and reionization using 21-cm power spectra with Marginal Neural Ratio Estimation” Saxena+ https://arxiv.org/abs/2303.07339\n- “Peregrine: Sequential simulation-based inference for gravitational wave signals”, Bhardwaj+ https://arxiv.org/abs/2304.02035\n- “Albatross: A scalable simulation-based inference pipeline for analysing stellar streams in the Milky Way”, Alvey+ https://arxiv.org/abs/2304.02032\n\n\nFurther information\n-------------------\n\n* **Documentation \u0026 installation**: https://swyft.readthedocs.io/\n* **Example usage**: https://swyft.readthedocs.io/en/latest/tutorial-notebooks.html\n* **Source code**: https://github.com/undark-lab/swyft\n* **Support \u0026 discussion**: https://github.com/undark-lab/swyft/discussions\n* **Bug reports**: https://github.com/undark-lab/swyft/issues\n* **Contributing**: https://swyft.readthedocs.io/en/latest/contributing-link.html\n* **Citation**: https://swyft.readthedocs.io/en/latest/citation.html\n\n\n*Swyft* history\n---------------\n\n* As of v0.4.0, *Swyft* is based on pytorch-lightning, with a completely updated\n* `v0.3.2 \u003chttps://github.com/undark-lab/swyft/releases/tag/v0.3.2\u003e`_ is the version that was submitted to `JOSS \u003chttps://joss.theoj.org/papers/10.21105/joss.04205\u003e`_.\n* `tmnre \u003chttps://github.com/bkmi/tmnre\u003e`_ is the implementation of the paper `Truncated Marginal Neural Ratio Estimation \u003chttps://arxiv.org/abs/2107.01214\u003e`_.\n* `v0.1.2 \u003chttps://github.com/undark-lab/swyft/releases/tag/v0.1.2\u003e`_ is the implementation of the paper `Simulation-efficient marginal posterior estimation with swyft: stop wasting your precious time \u003chttps://arxiv.org/abs/2011.13951\u003e`_.\n\nRelevant packages\n-----------------\n\n* `sbi \u003chttps://github.com/mackelab/sbi\u003e`_ is a collection of simulation-based inference methods. Unlike *Swyft*, the repository does not include our truncation scheme nor marginal estimation of posteriors.\n\n* `lampe \u003chttps://github.com/francois-rozet/lampe\u003e`_ is an implementation of amoritzed simulation-based inference methods aimed at simulation-based inference researchers due to its flexibility.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fundark-lab%2Fswyft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fundark-lab%2Fswyft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fundark-lab%2Fswyft/lists"}