Releases: bayesflow-org/bayesflow
2.0.12: New Transformers and PyMC Wrapper
This release includes several improvements, new integrations, and maintenance updates.
Highlights
-
Modernized transformers and deep sets (Breaking)
Updated transformer implementations aligning with modern best-practices for faster convergence and more expressive summary networks. -
PyMC wrapper for Neural Likelihood and Neural Ratio Estimation
Added the long awaited PyMC wrapper supporting Neural Likelihood Estimation and Neural Ratio Estimation out of the box. Plug into any PyMC workflow as easy as:
from bayesflow.wrappers.pymc import NeuralDistribution
# works the same way with ratio or a continuous approximator
pymc_dist = NeuralDistribution(approximator=my_approximator, param_names=["a", "b", "c"])
New tutorials:
-
GLASS sampler for flow matching
Added support for the GLASS sampler in flow matching workflows. -
Improved testing suite
Expanded and improved tests to increase reliability and coverage. -
Minor bug fixes and improvements
Includes smaller fixes, cleanup, and general quality-of-life improvements.
2.0.11: Compositional diffusion for hierarchical models and more
What's Changed
- Fix unconditional sampling by @arrjon
- Docs: Sensible treatment of versions by @han-ol
- Improve docstrings in workflows and method order in
BasicWorkflowby @han-ol - Improve documentation and version handling in workflows by @LarsKue
- Sample method determinism by @han-ol
- Allow Ordered/OrderedQuantiles links to handle axes shorter than 3 by @han-ol
- Compositional sampling by @arrjon - efficiently simulate and fit hierarchical Bayesian models; a new tutorial is also available!
- Fix optimizer, custom metrics, and display bugs by @stefanradev93
- Enable sample passing to diagnostic methods in workflow by @stefanradev93
- Improve computation of marginal Bayes (N)RMSE for more dynamic ranges by @stefanradev93
- New user guide by @stefanradev93 - a completely revamped and streamlined user guide demonstrating all major aspects of the library
- Sanitize Couplings, MLPs, and a few other backend improvements by @stefanradev93
Full Changelog: v2.0.10...v2.0.11
PS: Agentic AI is Here
Feel free to also check out and improve on our BayesFlow Agentic Skill at https://github.com/Learning-Bayesian-Statistics/baygent-skills/tree/main.
2.0.10: Mixture scores and minor fixes
✨ Release notes
This release adds mixture scores for parametric distributions which were missing from the 2.0.9 release, along some minor fixes and improvements for the test and publishing workflows, corrections to the docs, and more intelligent coverage targets. Happy amortizing!
🆕 Added
- Mixture scores for parametric distributions
Full Changelog: v2.0.9...v2.0.10
2.0.9 - Amortize whatever you like, however you like
Release notes ✨
The next BayesFlow comes with a greatly refactored codebase and various new functionality. Saved networks in versions > 2.0.8 may not deserialize properly, so new workflows should update and existing workflows relying on pretrained networks should pin to 2.0.8. Serialization will be backward compatible starting with the next release.
Added 🆕
- Maximally flexible sampling and inference interfaces for arbitrary shapes and data types (e.g., images, graphs)
- Maximally flexible diffusion models, flow matching, and consistency models
- Guidance and target masking for all diffusion-like models
- Maximally flexible interface for different masks (attention, classifier-free guidance, etc)
- A new set of SOTA UNet backbones for image generation (parameters to images) and estimation (images to parameters) and a dedicated tutorial.
- New tutorials, including a new video tutorial on diffusion models
- Contrastive neural ratio estimation (NRE) for MCMC integration as an alternative to NLE
- Hierarchical models through a graphical approximator and a graphical simulator interfaces (still mildly experimental)
- Ensembles of networks for training multiple summary and/or inference networks of different types with little to no hassle and a dedicated tutorial
- Mixture scores for more expressive parametric Bayes estimators
Changed 🔧
- Reimplementation of model comparison as a special case of scoring rule estimation (arbitrary Bayes estimators)
- Maintenance and lots of housekeeping 🧹
- Increased test coverage for summary and inference networks
- Small bug fixes
As always, happy amortizing and let us know about your success stories or any problems you encounter!
2.0.8 - The Dawn of Diffusion Models
Release notes ✨
The next BayesFlow release adds substantial new functionality, largely centered on diffusion models (score-based, flow-matching, consistency) for simulation-based inference (see https://arxiv.org/abs/2512.20685 for more details) and various improvements.
Added 🆕
- Guidance support for diffusion models.
- Optional batched sampling for large inference datasets, with progress tracking and wall-clock time reporting.
- Additional progress bars for sampling workflows.
- New options for flow matching, including conditional optimal transport.
- A more robust C2ST test, plus new diagnostics.
Changed 🔧
- Improved diffusion-model solvers.
- Vastly improved default backbones for diffusion-like models (diffusion, flow matching, consistency). Expect significant performance boosts! (BREAKING for loading old models trained in previous versions)
- Improved internal handling of inference phases, enabling arbitrary subnetworks that can process targets, conditions, and time in flexible ways.
- Expanded sampling flexibility (e.g., time-varying parameters, images, and other structured targets/conditions) and
sample_shapeoption.
Maintenance 🧹
- Increased test coverage.
- Multiple bug fixes.
As always, happy amortizing!
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
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
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.
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:
pip install "bayesflow>=2.0.4"v2.0.3 - fixes to serialization and new features
🚀 BayesFlow v2.0.3 Release Notes
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!