sbiax


Namesbiax JSON
Version 0.0.12 PyPI version JSON
download
home_pageNone
SummaryFast, parallel and lightweight simulation-based inference in JAX.
upload_time2024-10-27 14:30:09
maintainerNone
docs_urlNone
authorNone
requires_python~=3.12
licenseMIT License Copyright (c) [year] [fullname] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords bayesian-inference deep-learning generative-models jax likelihood-free-inference simulation-based-inference
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align='center'>sbiax</h1>
<h2 align='center'>Fast, lightweight and parallel simulation-based inference.</h2>

<!-- 
<picture>
  <source srcset="https://github.com/homerjed/sbipdf/blob/main/assets/cover_dark.png" media="(prefers-color-scheme: dark)">
  <source srcset="https://github.com/homerjed/sbipdf/blob/main/assets/cover.png" media="(prefers-color-scheme: light)">
  <img src="https://github.com/homerjed/sbipdf/blob/main/assets/cover.png" alt="Your image description">
</picture> -->
<p align="center">
  <picture>
    <source srcset="https://github.com/homerjed/sbiax/blob/main/assets/cover_dark.png" media="(prefers-color-scheme: dark)">
    <source srcset="https://github.com/homerjed/sbiax/blob/main/assets/cover.png" media="(prefers-color-scheme: light)">
    <img src="https://github.com/homerjed/sbiax/blob/main/assets/cover.png" alt="Your image description">
  </picture>
</p>

<!-- <p align="center">
    <picture>
        <source srcset="assets/cover_dark.png" media="(prefers-color-scheme: dark)">
        <source srcset="assets/cover.png" media="(prefers-color-scheme: light)">
        <img src="assets/cover.png" alt="Your image description">
    </picture>
</p> -->

`sbiax` is a lightweight library for simulation-based inference (SBI) with a fixed grid of simulations. 

<!-- The design puts the neural density estimator (NDE) models at the centre of the code, allowing for flexible combinations of different models.  -->

> [!WARNING]
> :building_construction: Note this repository is under construction, expect changes. :building_construction:

-----

### Design

<!-- A typical inference with SBI occurs with  

* fitting a density estimator to a set of simulations and parameters $(\xi, \pi)$ that may be compressed to summary statistics,
* the measurement of a datavector $\hat{\xi}$,
* the sampling of a posterior $p(\pi|\hat{\xi})$ conditioned on the measurement $\hat{\xi}$.

`sbiax` is designed to perform such an inference.  -->

In a typical inference problem the data likelihood is unknown. Using density-estimation SBI, we can proceed by

<!-- Bayesian analyses where the likelihood function is unknown can proceed with density-estimation simulation-based inference methods, which typically involve -->

* simulating a set of data and model parameters $\{(\boldsymbol{\xi}, \boldsymbol{\pi})_0, ..., (\boldsymbol{\xi}, \boldsymbol{\pi})_N\}$,
* obtaining a measurement $\hat{\boldsymbol{\xi}}$,
* compressing the simulations and the measurements - usually with a neural network or linear compression - to a set of summaries $\{(\boldsymbol{x}, \boldsymbol{\pi})_0, ..., (\boldsymbol{x}, \boldsymbol{\pi})_N\}$ and $\hat{\boldsymbol{x}}$, 
* fitting an ensemble of normalising flow or similar density estimation algorithms (e.g. a Gaussian mixture model),
* the optional optimisation of the parameters for the architecture and fitting hyperparameters of the algorithms,
* sampling the ensemble posterior (using an MCMC sampler if the likelihood is fit directly) conditioned on the datavector to obtain parameter constraints on the parameters of a physical model, $\boldsymbol{\pi}$.

`sbiax` is a code for implementing each of these steps.


<!-- #### a) Configuration

An inference is defined by a `config` file. This is a dictionary that includes

* the architecture(s) of the NDEs,
* how to train these models,
* how to sample these models (e.g. MCMC, ...),
* where to save models, posteriors and figures,
* and generally any other information for your experiments.

NDEs are grouped in an ensemble that defines its own ensemble-likelihood function given an observation.

#### b) Density estimation

A posterior or likelihood is derived from a set of simulations and parameters by fitting a generative model with some loss - this may be a diffusion model or a normalising flow. 

`sbiax` is designed to be centred around these algorithms and to adopt the latest innovations from the machine learning literature.

#### c) Compression 

Density estimation is one of the oldest problems in machine learning. To avoid the difficulties of fitting high-dimensional models to data it is common to compress the data. 

`sbiax` gives you common compression methods that use linear methods or neural networks.  -->

-----

### Usage

Install via

```pip install sbiax```

and have a look at [examples](https://github.com/homerjed/sbiax/tree/main/examples).
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sbiax",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "~=3.12",
    "maintainer_email": null,
    "keywords": "bayesian-inference, deep-learning, generative-models, jax, likelihood-free-inference, simulation-based-inference",
    "author": null,
    "author_email": "Jed Homer <jedhmr@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/05/f4/a62dde34e6444fc2c12436ec1dd75c68e17617d7fb3cbdd582a8df4abc56/sbiax-0.0.12.tar.gz",
    "platform": null,
    "description": "<h1 align='center'>sbiax</h1>\n<h2 align='center'>Fast, lightweight and parallel simulation-based inference.</h2>\n\n<!-- \n<picture>\n  <source srcset=\"https://github.com/homerjed/sbipdf/blob/main/assets/cover_dark.png\" media=\"(prefers-color-scheme: dark)\">\n  <source srcset=\"https://github.com/homerjed/sbipdf/blob/main/assets/cover.png\" media=\"(prefers-color-scheme: light)\">\n  <img src=\"https://github.com/homerjed/sbipdf/blob/main/assets/cover.png\" alt=\"Your image description\">\n</picture> -->\n<p align=\"center\">\n  <picture>\n    <source srcset=\"https://github.com/homerjed/sbiax/blob/main/assets/cover_dark.png\" media=\"(prefers-color-scheme: dark)\">\n    <source srcset=\"https://github.com/homerjed/sbiax/blob/main/assets/cover.png\" media=\"(prefers-color-scheme: light)\">\n    <img src=\"https://github.com/homerjed/sbiax/blob/main/assets/cover.png\" alt=\"Your image description\">\n  </picture>\n</p>\n\n<!-- <p align=\"center\">\n    <picture>\n        <source srcset=\"assets/cover_dark.png\" media=\"(prefers-color-scheme: dark)\">\n        <source srcset=\"assets/cover.png\" media=\"(prefers-color-scheme: light)\">\n        <img src=\"assets/cover.png\" alt=\"Your image description\">\n    </picture>\n</p> -->\n\n`sbiax` is a lightweight library for simulation-based inference (SBI) with a fixed grid of simulations. \n\n<!-- The design puts the neural density estimator (NDE) models at the centre of the code, allowing for flexible combinations of different models.  -->\n\n> [!WARNING]\n> :building_construction: Note this repository is under construction, expect changes. :building_construction:\n\n-----\n\n### Design\n\n<!-- A typical inference with SBI occurs with  \n\n* fitting a density estimator to a set of simulations and parameters $(\\xi, \\pi)$ that may be compressed to summary statistics,\n* the measurement of a datavector $\\hat{\\xi}$,\n* the sampling of a posterior $p(\\pi|\\hat{\\xi})$ conditioned on the measurement $\\hat{\\xi}$.\n\n`sbiax` is designed to perform such an inference.  -->\n\nIn a typical inference problem the data likelihood is unknown. Using density-estimation SBI, we can proceed by\n\n<!-- Bayesian analyses where the likelihood function is unknown can proceed with density-estimation simulation-based inference methods, which typically involve -->\n\n* simulating a set of data and model parameters $\\{(\\boldsymbol{\\xi}, \\boldsymbol{\\pi})_0, ..., (\\boldsymbol{\\xi}, \\boldsymbol{\\pi})_N\\}$,\n* obtaining a measurement $\\hat{\\boldsymbol{\\xi}}$,\n* compressing the simulations and the measurements - usually with a neural network or linear compression - to a set of summaries $\\{(\\boldsymbol{x}, \\boldsymbol{\\pi})_0, ..., (\\boldsymbol{x}, \\boldsymbol{\\pi})_N\\}$ and $\\hat{\\boldsymbol{x}}$, \n* fitting an ensemble of normalising flow or similar density estimation algorithms (e.g. a Gaussian mixture model),\n* the optional optimisation of the parameters for the architecture and fitting hyperparameters of the algorithms,\n* sampling the ensemble posterior (using an MCMC sampler if the likelihood is fit directly) conditioned on the datavector to obtain parameter constraints on the parameters of a physical model, $\\boldsymbol{\\pi}$.\n\n`sbiax` is a code for implementing each of these steps.\n\n\n<!-- #### a) Configuration\n\nAn inference is defined by a `config` file. This is a dictionary that includes\n\n* the architecture(s) of the NDEs,\n* how to train these models,\n* how to sample these models (e.g. MCMC, ...),\n* where to save models, posteriors and figures,\n* and generally any other information for your experiments.\n\nNDEs are grouped in an ensemble that defines its own ensemble-likelihood function given an observation.\n\n#### b) Density estimation\n\nA posterior or likelihood is derived from a set of simulations and parameters by fitting a generative model with some loss - this may be a diffusion model or a normalising flow. \n\n`sbiax` is designed to be centred around these algorithms and to adopt the latest innovations from the machine learning literature.\n\n#### c) Compression \n\nDensity estimation is one of the oldest problems in machine learning. To avoid the difficulties of fitting high-dimensional models to data it is common to compress the data. \n\n`sbiax` gives you common compression methods that use linear methods or neural networks.  -->\n\n-----\n\n### Usage\n\nInstall via\n\n```pip install sbiax```\n\nand have a look at [examples](https://github.com/homerjed/sbiax/tree/main/examples).",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) [year] [fullname]  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Fast, parallel and lightweight simulation-based inference in JAX.",
    "version": "0.0.12",
    "project_urls": {
        "repository": "https://github.com/homerjed/sbi1pdf"
    },
    "split_keywords": [
        "bayesian-inference",
        " deep-learning",
        " generative-models",
        " jax",
        " likelihood-free-inference",
        " simulation-based-inference"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b7f2a578e4a2109ac88bcf09b4796a1a6e6c7d33742da77f91b895c1b7421358",
                "md5": "5d6721b0a4c81e41934aa2940dd04bd0",
                "sha256": "b8bdd5aae6caf254ca83fe04a7edc8e5a5d4786ee0761c9c9c2f51d425b067b7"
            },
            "downloads": -1,
            "filename": "sbiax-0.0.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5d6721b0a4c81e41934aa2940dd04bd0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.12",
            "size": 3522558,
            "upload_time": "2024-10-27T14:30:06",
            "upload_time_iso_8601": "2024-10-27T14:30:06.944718Z",
            "url": "https://files.pythonhosted.org/packages/b7/f2/a578e4a2109ac88bcf09b4796a1a6e6c7d33742da77f91b895c1b7421358/sbiax-0.0.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "05f4a62dde34e6444fc2c12436ec1dd75c68e17617d7fb3cbdd582a8df4abc56",
                "md5": "faa12b1389931b27d6af2cf0622bafa8",
                "sha256": "b617919eddb4d15360fca4dbeb3907a7491d7ccec8d242cb51d2f6b93ef39143"
            },
            "downloads": -1,
            "filename": "sbiax-0.0.12.tar.gz",
            "has_sig": false,
            "md5_digest": "faa12b1389931b27d6af2cf0622bafa8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.12",
            "size": 3486830,
            "upload_time": "2024-10-27T14:30:09",
            "upload_time_iso_8601": "2024-10-27T14:30:09.388306Z",
            "url": "https://files.pythonhosted.org/packages/05/f4/a62dde34e6444fc2c12436ec1dd75c68e17617d7fb3cbdd582a8df4abc56/sbiax-0.0.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-27 14:30:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "homerjed",
    "github_project": "sbi1pdf",
    "github_not_found": true,
    "lcname": "sbiax"
}
        
Elapsed time: 1.13980s