Recent Releases of BayesFlow
BayesFlow - 2.0.7 - More Powerful Diagnostics, Bugfixes, and Automatic Selection of Backends
What's Changed
- More expressive diagnostics for joint calibration. Better pair plots with arbitrary quantities.
- Better default settings for DeepSets and Diffusion Models.
- Automatic selection of backends. No more fiddling with
os.environunless needed! - Minor bugfixes
- New tutorial on spatial data
Scientific Software - Peer-reviewed
- Python
Published by stefanradev93 6 months ago
BayesFlow - 2.0.6 - Stateless Adapters, Augmentations, Bugfixes, and Better Diffusion Models
- Various score-based diffusion models are now directly available in the
networksmodule. - ECDF Calibration plots support arbitrary test statistics for more expressive diagnostics
- Adapters are now completely stateless, leading to less hassle for standardization
- A new module
augmentationswill collect non-serializable transforms applied during training. NNPE for robust training (Ward et al., 2022) has been added, and many more are coming! - Small bugfixes with internal passing of arguments have been applied
- Two new tutorial notebooks are available on likelihood learning and multimodal inference
Scientific Software - Peer-reviewed
- Python
Published by stefanradev93 7 months ago
BayesFlow - 2.0.5-patch - Log gamma statistic and standardization layer fix
What's Changed
- An important bugfix for standardization layers on multi-input networks and 3D > inputs.
- Added log gamma statistic for better simulation-based checking as proposed by: Modrรกk, M., Moon, A. H., Kim, S., Bรผrkner, P., Huurre, N., Faltejskovรก, K., ... & Vehtari, A. (2025). Simulation-based calibration checking for Bayesian computation: The choice of test quantities shapes sensitivity. Bayesian Analysis, 20(2), 461-488.
Scientific Software - Peer-reviewed
- Python
Published by stefanradev93 8 months ago
BayesFlow - 2.0.4 -Diffusion models, bugfixes, new standardization utility, and more
๐ BayesFlow v2.0.4 โ Flexibility and Stability
Weโre excited to announce BayesFlow v2.0.4 โ a major release packed with stability upgrades, smarter networks, diffusion models, and tools for multimodal inference.
โจ Highlights
๐ Diffusion Models for Inference
- Integrated a flexible
DiffusionModelimplementation following Kingma et al. (2023) - Added SDE solvers and flexible sampling support. You can try out different diffusion model flavors!
- Unified behavior across inference networks and removed deprecations of
subnet_kwargs
๐ง Smarter Networks and Fusion
- Introduced
FusionNetworkfor multimodal learning via late fusion - New
Group/Ungrouptransforms for flexible input structuring - Redesigned how summary/inference networks are discovered and dispatched
๐งช Simulation & Data Handling
- Added
subsample()andtake()transforms with percent-based slicing - Included *NaN replacement transform for taking care of missing values
- Enabled batch simulation utilities and new dataset augmentation strategies
- Improved consistency for disk/offline datasets, including shuffle control
- Enabled arbitrary data augmentations to datasets for transformations applied only during training
๐ Stability and Standardization
- Created new
Standardizationlayers that are now managed by approximators - no need for stateful adapters - Introduced moving mean/variance tracking with stable zero-variance handling
- Replaced unstable
PositiveDefinitelink with robust CholeskyFactor estimation for MVN approximate distributions - Fixed validation loss aggregation
๐งฎ Model Comparison & Approximators
- Better handling of heterogeneous simulator outputs in model comparison
- Overhauled metrics tracking with train/val split and custom metric support
- Streamlined all approximators with unified
.prepare_data()logic andlog_probfixes - Serialization is now safer and more consistent across backends and training stages
๐งช Diagnostics, Docs, and Dev Tools
- New tutorials: likelihood estimation, multimodal simulations, and a book on Cognitive Modeling with BayesFlow
- Improved pair plots, better spacing, and legend layering
- Added new notebooks and polished documentation for approximators, diagnostics, and data handling
- BayesFlow now officially supports Python 3.12
๐งฐ Under-the-Hood Improvements
- Custom
Sequentialmodule to resolve Keras build/serialization issues - More robust test suite with extended coverage for transforms, metrics, networks, and approximators
- Smarter dispatching of networks and dynamic simulator configurations
๐ง Breaking & Deprecated
standardizeadapter transforms should be used only with precomputed loc and scale. โ rely on the new built-in standardization utility of approximators!- Deprecated
approx.summariesโ useapprox.summarizeinstead - Moved toward
FutureWarningfor deprecated features - Use
probsinstead oflogitsforModelComparisonApproximator
๐ฅ Special Thanks to Contributors
Big kudos to @LarsKue, @valentinpratz, @han-ol, @arrjon, @elseml, @jerrymhuang, @daniel-habermann for pushing this release forward!
๐ Ready to try it?
Install or upgrade via:
bash
pip install "bayesflow>=2.0.4"
Scientific Software - Peer-reviewed
- Python
Published by stefanradev93 8 months ago
BayesFlow - v2.0.3 - fixes to serialization and new features
๐ BayesFlow v2.0.3 Release Notes
โ ๏ธ Important Notice: Breaking Changes
This release introduces significant changes to the serialization pipeline and is not backward-compatible with v2.0.2 or earlier. Models saved with older versions of BayesFlow will likely be incompatible with this release, but models trained in the future will be backward compatible with this release.
We strongly recommend updating your workflows and referring to the updated documentation to ensure a smooth transition.
๐ Documentation Updates
Enhanced the README.md with: - A detailed guide for migrating from BayesFlow v1.x to v2. - Clear warnings about breaking changes and missing features (e.g., hierarchical models, MCMC). - Pointers for users seeking parity with legacy functionality. See changes โ
๐ง Backend Enhancements
- Simplified version management:
__version__is now dynamically set using importlib.metadata. - Removed redundant exception handling for unsupported package imports.
๐ Transform Enhancements
New Feature: Added support for log_det_jac (log-determinant Jacobian) in multiple transform classes:
- Constrain
- Concatenate
- Drop
The Adapter class now optionally returns the log_det_jac alongside transformed data in both forward and inverse methods.
These improvements enhance support for probabilistic modeling workflows involving change-of-variable techniques.
๐งฌ Serialization Improvements
- Applied the @serializable decorator with explicit namespace="bayesflow.adapters" to key transform classes: AsSet, Broadcast, Constrain, and others. This improves the consistency and reliability of object serialization across the library, especially for save/load operations in custom pipelines.
โ Summary
This release improves usability, extensibility, and transform robustness, especially for users of advanced transformations. While it introduces breaking changes, it also lays a more stable foundation for future developments. Stay tuned!
Scientific Software - Peer-reviewed
- Python
Published by stefanradev93 10 months ago
BayesFlow - v2.0.2 Fixes to usability, tests, and flow matching
- More tests, including notebooks
- Fixed optimal transport for JAX
- Improved dispatch for inference and summary networks (used in workflows)
- Mixture distributions as latent spaces
- Improved README
- Fixed a warning about missing
compile_from_configwhen loading approximators - Add NumFOCUS affiliation
- Add issue templates
- Removes the need to explicitly drop unused variables in custom Adapters
Scientific Software - Peer-reviewed
- Python
Published by stefanradev93 10 months ago
BayesFlow - v2.0.1 - fixes and performance improvement
- Fixes bug with optimal transport for flow matching
- Improved speed of import by 1200%
- Improved tests for consistency models
Scientific Software - Peer-reviewed
- Python
Published by stefanradev93 10 months ago
BayesFlow - ๐ BayesFlow v2.0 (Neo) Has Officially Arrived!
๐ BayesFlow 2.0 is here! ๐
We're thrilled to officially release BayesFlow 2.0 - a major leap forward in amortized Bayesian inference using modern neural networks. Whether you're a researcher, practitioner, or just getting started with Bayesian modeling, BayesFlow 2 is built to help you go from idea to inference faster than ever.
๐ฅ What's New in v2.0?
Multi-backend support with Keras 3: Choose your favorite ML framework - JAX, PyTorch, or TensorFlow - and switch seamlessly.
Cleaner, faster API: New workflows and interfaces make it easier than ever to build, train, and evaluate your models.
More neural network architectures: A rich set of ready-to-use building blocks tailored for simulation-based inference.
Smarter, more flexible design: Refined from the ground up to align with the latest advances in generative AI and Bayesian modeling.
๐ง What is BayesFlow?
BayesFlow lets you harness generative neural networks for fast and flexible Bayesian inference with any simulator. Whether you're estimating parameters, comparing models, or designing experiments, BayesFlow helps you turn simulations into statistical insight.
Check out the 3-step conceptual overview:
Choose your backend โ thanks to Keras 3, you're free to use JAX, PyTorch, or TensorFlow.
Define your simulator โ write your model in pure Python and generate data effortlessly.
Select your inference algorithm โ train flexible neural networks to estimate what matters most.
๐ Getting Started Is Easy
```py3 import bayesflow as bf
workflow = bf.BasicWorkflow( inferencenetwork=bf.networks.CouplingFlow(), summarynetwork=bf.networks.TimeSeriesNetwork(), inferencevariables=["parameters"], summaryvariables=["observables"], simulator=bf.simulators.SIR() )
history = workflow.fitonline(epochs=15, batchsize=32, numbatchesperepoch=200) diagnostics = workflow.plotdefaultdiagnostics(testdata=300) ```
๐งช Check out our growing library of tutorials and notebooks, from basic regression to Bayesian experimental design. Even better - contribute your own!
๐ฆ Installation
You can install the latest version directly from PyPI or GitHub.
And donโt forget to install a supported backend - recommend JAX for top performance ๐
BayesFlow 2.0 is fast, flexible, and freaking awesome. We canโt wait to see what you build with it.
Let us know what you think, and if you create something cool - open a PR or share it with the community! ๐
The BayesFlow Team
Scientific Software - Peer-reviewed
- Python
Published by stefanradev93 10 months ago
BayesFlow - v1.1.6
What's Changed
- Hotfix pip installation error with Apple Silicon by @marvinschmitt in https://github.com/stefanradev93/BayesFlow/pull/155
Full Changelog: https://github.com/stefanradev93/BayesFlow/compare/v1.1.5...v1.1.6
Scientific Software - Peer-reviewed
- Python
Published by marvinschmitt almost 2 years ago
BayesFlow - v1.1.5
What's Changed
- set label names in plot_recovery() by @levolz in https://github.com/stefanradev93/BayesFlow/pull/102
- Development by @stefanradev93 in https://github.com/stefanradev93/BayesFlow/pull/103
- add labelfontsize and valuefontsize by @LuSchumacher in https://github.com/stefanradev93/BayesFlow/pull/106
- Optimization: add setting for tqdm mininterval by @vpratz in https://github.com/stefanradev93/BayesFlow/pull/108
- add nrow and ncol argument where applicable by @LuSchumacher in https://github.com/stefanradev93/BayesFlow/pull/109
- fix some typos and out-of-sync docstrings by @daniel-habermann in https://github.com/stefanradev93/BayesFlow/pull/111
- add **kwargs to diagnostics.plot_recovery by @marvinschmitt in https://github.com/stefanradev93/BayesFlow/pull/112
- Merge with dev by @stefanradev93 in https://github.com/stefanradev93/BayesFlow/pull/115
- Minor improvements by @elseml in https://github.com/stefanradev93/BayesFlow/pull/117
- Update README.md with forum by @elseml in https://github.com/stefanradev93/BayesFlow/pull/116
- update tutorial notebook 1 by @rusty-electron in https://github.com/stefanradev93/BayesFlow/pull/120
- Minimal Fix for Broken Tests by @LarsKue in https://github.com/stefanradev93/BayesFlow/pull/130
- Drop Support for Python 3.9, Add Support for Python 3.11 by @LarsKue in https://github.com/stefanradev93/BayesFlow/pull/132
- fix tutorial notebook 1 toc links and update some text by @rusty-electron in https://github.com/stefanradev93/BayesFlow/pull/136
- Make diagnostic plots work with one-parameter models by @Kucharssim in https://github.com/stefanradev93/BayesFlow/pull/137
- Fix offline training for model comparison ignoring shared context by @elseml in https://github.com/stefanradev93/BayesFlow/pull/139
- README - update minimal example by @vpratz in https://github.com/stefanradev93/BayesFlow/pull/141
- update TOCs of example notebooks by @rusty-electron in https://github.com/stefanradev93/BayesFlow/pull/142
- Bump up to Series 1.1.5 update by @stefanradev93 in https://github.com/stefanradev93/BayesFlow/pull/143
- add notebook: amortized point estimation by @vpratz in https://github.com/stefanradev93/BayesFlow/pull/145
- Bayes Estimators: Loss functions with flexible signature by @han-ol in https://github.com/stefanradev93/BayesFlow/pull/147
- Development by @stefanradev93 in https://github.com/stefanradev93/BayesFlow/pull/150
New Contributors
- @daniel-habermann made their first contribution in https://github.com/stefanradev93/BayesFlow/pull/111
- @rusty-electron made their first contribution in https://github.com/stefanradev93/BayesFlow/pull/120
- @LarsKue made their first contribution in https://github.com/stefanradev93/BayesFlow/pull/130
- @Kucharssim made their first contribution in https://github.com/stefanradev93/BayesFlow/pull/137
- @han-ol made their first contribution in https://github.com/stefanradev93/BayesFlow/pull/147
Full Changelog: https://github.com/stefanradev93/BayesFlow/compare/v1.1.4...v1.1.5
Scientific Software - Peer-reviewed
- Python
Published by stefanradev93 almost 2 years ago
BayesFlow - New feature and minor bugfixes
- Bugfix in
SimulationMemoryaffecting the use of empty folders for initializing aTrainer; - Bugfix in
Trainer.train_from_presimulation()for model comparison tasks; - Added a classifier two-sample test (C2ST) function
c2stincomputational_utilities.
Scientific Software - Peer-reviewed
- Python
Published by stefanradev93 over 2 years ago
BayesFlow - Bugfixes and improved documentation
- Bugfix related to training
SetTransformerwith induced points - Bugfix for offline training of transformers with variable sizes
- Complete revamp of documentation, README, and tutorials
Scientific Software - Peer-reviewed
- Python
Published by stefanradev93 over 2 years ago
BayesFlow - PyPI Publish
Enable PyPI integration through GitHub workflows.
Scientific Software - Peer-reviewed
- Python
Published by stefanradev93 over 2 years ago
BayesFlow - Beyond Beta!
Following multiple improvements and being actively used in multiple projects, the BayesFlow library is ready to move beyond the beta phase!
Features:
1. Added option for permutation='learnable' when creating an InvertibleNetwork
2. Added option for coupling_design in ["affine", "spline", "interleaved"] when creating an InvertibleNetwork
3. Simplified passing additional settings to the internal networks. For instance, you
can now simply do
inference_network = InvertibleNetwork(num_params=20, coupling_net_settings={'mc_dropout': True})
to get a Bayesian neural network.
4. PMPNetwork has been added for model comparison according to findings in https://arxiv.org/abs/2301.11873
5. Publication-ready calibration diagnostic for expected calibration error (ECE) in a model comparison setting has been
added to diagnostics.py and is accessible as plot_calibration_curves()
6. A new module experimental has been added currently containing rectifiers.py.
7. Default settings for transformer-based architectures.
8. Numerical calibration error using posterior_calibration_error()
General Improvements:
1. Improved docstrings and consistent use of keyword arguments vs. configuration dictionaries
2. Increased focus on transformer-based architectures as summary networks
3. Figures resulting diagnostics.py have been improved and prettified
4. Added a module sensitivity.py for testing the sensitivity of neural approximators to model misspecification
5. Multiple bugfixes, including a major bug affecting the saving and loading of learnable permutations
The project now also features automatic PyPI publishing. :)
Scientific Software - Peer-reviewed
- Python
Published by stefanradev93 over 2 years ago
BayesFlow - BayesFlow Future is Here!
Welcome to the Future!
Scientific Software - Peer-reviewed
- Python
Published by stefanradev93 about 3 years ago