Skip to main content

EPI

pages-build-deployment Build & Publish Documentation Publish to PyPI pytest

flake8 black License: MIT Python PyPI

Eulerian Parameter Inference (EPI) is a powerful and novel method for inverse model parameter inference. The eulerpi package provides an implementation of the EPI algorithm, which takes observed data and a model as input and returns a parameter distribution consistent with the observed data by solving the inverse problem directly. In case the model describes a one-to-one mapping between parameters and simulation results, the inferred parameter distribution is the true underlying distribution.

Documentation

The full documentation of this software, including a detailed tutorial on how to use EPI and the api documentation, can be found under Documentation.

Features

EPI supports

  • SBML ode models
  • User provided models
  • Models with automatic differentiation using jax

Installation

The package is available on pypi and can be installed with:

pip install eulerpi

or

pip install eulerpi[sbml]

for the support of sbml models.

Make sure that you have the following C++ libraries installed

sudo apt install -y swig libblas-dev libatlas-base-dev libhdf5-dev

You can also build the library from the latest source code by following the Development Quickstart Guide.

Using the library

To use EPI, derive your model from the BaseModel class and implement the abstract functions. Here's an example code snippet:

# my_model.py

import jax.numpy as jnp

from eulerpi.core.models import BaseModel

class MyModel(BaseModel):

    param_dim = N # The dimension of a parameter point
    data_dim = M # The dimension of a data point

    def forward(self, param):
        return jnp.array(...)

    def jacobian(self, param):
        return jnp.array(...)

To evaluate the model and infer the parameter distribution, call:

from eulerpi.sampling import inference

from my_model import MyModel

# This line is needed for multiprocessing in python
if __name__ == "__main__":
    central_param = np.array([0.5, -1.5, ...])
    param_limits = np.array([[0.0, 1.0], [-3.0, 0.0], ...])

    model = MyModel(central_param, param_limits)
    inference(model=model, data="my_data.csv")

The data argument can be a numpy-2d-array or a PathLike object that points to a CSV file. In the example shown above, the CSV file my_data.csv should contain the data in the following format:

datapoint_dim1, datapoint_dim2, datapoint_dim3, ..., datapoint_dimN
datapoint_dim1, datapoint_dim2, datapoint_dim3, ..., datapoint_dimN
datapoint_dim1, datapoint_dim2, datapoint_dim3, ..., datapoint_dimN
...
datapoint_dim1, datapoint_dim2, datapoint_dim3, ..., datapoint_dimN

This corresponds to a matrix with the shape nSamples x data_dim. For more available options and parameters for the inference method, please refer to the api documentation. Note that the inference can be done with grid-based methods (dense grids, sparse grids) or sampling methods (mcmc).

The results are stored in the following location:

  • ./Applications/<ModelName>/.../OverallParams.csv
  • ./Applications/<ModelName>/.../OverallSimResults.csv
  • ./Applications/<ModelName>/.../OverallDensityEvals.csv

These files contain the sampled parameters, the corresponding data points obtained from the model forward pass, and the corresponding density evaluation.

Metadata

Release files for eulerpi 0.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eulerpi 0.11.0
File Size Uploaded
eulerpi-0.11.0.tar.gz 861.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eulerpi 0.11.0
File Interpreter ABI Platform
eulerpi-0.11.0-py3-none-any.whl Python 3 none any Details

Total release size: 934.7 kB

Release files / eulerpi-0.11.0.tar.gz

Download URL eulerpi-0.11.0.tar.gz
Size 861.5 kB
Tags Source
SHA-256 checksum
How to use checksums
91fe4852ee207a2aaf2e55505dc4651997a4021df5c5af316d4d403dca748721
BLAKE2b-256 checksum
How to use checksums
b4b2cf4501bd82f09e2d397e3a30265d45171510ae1d9c88a4c3b17fad3113ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.20

Release files / eulerpi-0.11.0-py3-none-any.whl

Download URL eulerpi-0.11.0-py3-none-any.whl
Size 73.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7d2ba2fefda5958a8a45f85bf9d6841db6e4c8900d51c2fb33502fedc305c17
BLAKE2b-256 checksum
How to use checksums
87764e5b778b790a267a5ea9940b7287136ba7f0cbafedfe7e41c7440d5cbb02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.20

Release history Release notifications | RSS feed

This release

0.11.0 This release

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page