Releases: bayesflow-org/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_config
when loading approximators - Add NumFOCUS affiliation
- Add issue templates
- Removes the need to explicitly drop unused variables in custom Adapters
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
🚀 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
import bayesflow as bf
workflow = bf.BasicWorkflow(
inference_network=bf.networks.CouplingFlow(),
summary_network=bf.networks.TimeSeriesNetwork(),
inference_variables=["parameters"],
summary_variables=["observables"],
simulator=bf.simulators.SIR()
)
history = workflow.fit_online(epochs=15, batch_size=32, num_batches_per_epoch=200)
diagnostics = workflow.plot_default_diagnostics(test_data=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
v1.1.6
What's Changed
- Hotfix pip installation error with Apple Silicon by @marvinschmitt in #155
Full Changelog: v1.1.5...v1.1.6
v1.1.5
What's Changed
- set label names in plot_recovery() by @levolz in #102
- Development by @stefanradev93 in #103
- add label_fontsize and value_fontsize by @LuSchumacher in #106
- Optimization: add setting for tqdm mininterval by @vpratz in #108
- add n_row and n_col argument where applicable by @LuSchumacher in #109
- fix some typos and out-of-sync docstrings by @daniel-habermann in #111
- add **kwargs to diagnostics.plot_recovery by @marvinschmitt in #112
- Merge with dev by @stefanradev93 in #115
- Minor improvements by @elseml in #117
- Update README.md with forum by @elseml in #116
- update tutorial notebook 1 by @rusty-electron in #120
- Minimal Fix for Broken Tests by @LarsKue in #130
- Drop Support for Python 3.9, Add Support for Python 3.11 by @LarsKue in #132
- fix tutorial notebook 1 toc links and update some text by @rusty-electron in #136
- Make diagnostic plots work with one-parameter models by @Kucharssim in #137
- Fix offline training for model comparison ignoring shared context by @elseml in #139
- README - update minimal example by @vpratz in #141
- update TOCs of example notebooks by @rusty-electron in #142
- Bump up to Series 1.1.5 update by @stefanradev93 in #143
- add notebook: amortized point estimation by @vpratz in #145
- Bayes Estimators: Loss functions with flexible signature by @han-ol in #147
- Development by @stefanradev93 in #150
New Contributors
- @daniel-habermann made their first contribution in #111
- @rusty-electron made their first contribution in #120
- @LarsKue made their first contribution in #130
- @Kucharssim made their first contribution in #137
- @han-ol made their first contribution in #147
Full Changelog: v1.1.4...v1.1.5
JOSS
State of software at JOSS publication.
New feature and minor bugfixes
- Bugfix in
SimulationMemory
affecting 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
c2st
incomputational_utilities
.
Bugfixes and improved documentation
- Bugfix related to training
SetTransformer
with induced points - Bugfix for offline training of transformers with variable sizes
- Complete revamp of documentation, README, and tutorials
PyPI Publish
Enable PyPI integration through GitHub workflows.
Beyond Beta!
Following multiple improvements and being actively used in multiple projects, the BayesFlow library is ready to move beyond the beta phase!
Features:
- Added option for
permutation='learnable'
when creating anInvertibleNetwork
- Added option for
coupling_design in ["affine", "spline", "interleaved"]
when creating anInvertibleNetwork
- 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. PMPNetwork
has been added for model comparison according to findings in https://arxiv.org/abs/2301.11873- Publication-ready calibration diagnostic for expected calibration error (ECE) in a model comparison setting has been
added todiagnostics.py
and is accessible asplot_calibration_curves()
- A new module
experimental
has been added currently containingrectifiers.py
. - Default settings for transformer-based architectures.
- Numerical calibration error using
posterior_calibration_error()
General Improvements:
- Improved docstrings and consistent use of keyword arguments vs. configuration dictionaries
- Increased focus on transformer-based architectures as summary networks
- Figures resulting
diagnostics.py
have been improved and prettified - Added a module
sensitivity.py
for testing the sensitivity of neural approximators to model misspecification - Multiple bugfixes, including a major bug affecting the saving and loading of learnable permutations
The project now also features automatic PyPI publishing. :)