Tokenised Flow Matching for Posterior Estimation
TFMPE is a Python package for efficient posterior estimation using structured parameter representations and flow matching techniques. It provides modular tools for parameter estimation, data preprocessing, and neural network architectures optimized for scientific computing applications.
We highly recommend installing in a virtualenv for reproducibility.
Install the core package with default dependencies:
pip install -e .For development work including testing and type checking:
pip install -e .[dev]For running examples with visualization capabilities:
pip install -e .[examples]Install everything for full development and examples:
pip install -e .[dev,examples]- Python ≥ 3.10
The project uses pytest with custom markers for different test categories:
# Run standard test suite (fast tests only)
python -m pytest test/
# Run all tests including slow ones
python -m pytest test/ -m "slow or not slow"
# Run only slow tests
python -m pytest test/ -m "slow"
# Run speed benchmarks
python -m pytest test/ -m "speed"
# Run scale benchmarks
python -m pytest test/ -m "scale"
# Run all tests (including benchmarks)
python -m pytest test/ -m ""Static type analysis: pyright
Linting: ruff check
Build documentation locally:
pip install -e .[docs]
mkdocs buildServe documentation with live reload:
mkdocs servetfmpe/
├── metrics/ # Metrics for analysis of parameter inference
├── estimators/ # Parameter estimators
├── bijectors/ # Bijectors for structured parameter sets
├── preprocessing/ # Pipelines for processing datasets
├── sampling/ # Sampling algorithms for training estimators
└── nn/ # Neural networks
└── transformer/ # Transformer model architectures
Examples and usage documentation will be added as the package develops.
See CONTRIBUTING.md for contribution guidelines and development workflow options.
See LICENSE.md