Welcome to the beta-version of our BayesFlow library for simulation-based Bayesian parameter estimation and model comparison!
For starters, check out the walkthrough notebooks Parameter_Estimation_Workflow.ipynb and Model_Comparison_Workflow.ipynb.
A cornerstone idea of amortized Bayesian inference is to employ generative neural networks for parameter estimation, model comparison and model validation when working with intractable simulators whose behavior as a whole is too complex to be described analytically. The figure below presents a higher-level overview of neurally bootstrapped Bayesian inference.
A short conference paper reviewing amortized Bayesian inference with a focus on cognitive modeling can be found here:
https://arxiv.org/abs/2005.03899
The BayesFlow method incorporates a summary network and an inference network which are jointly optimized to invert a complex computational model (simulator). The summary network is responsible for learning the most informative data representations (i.e., summary statistics) in an end-to-end manner. The inference network is responsible for learning an invertible mapping between the posterior and an easy-to-sample-from latent space (e.g., Gaussian) for any possible observation or set of observations arising from the simulator. The BayesFlow method for amortized parameter estimation is based on our paper:
Radev, S. T., Mertens, U. K., Voss, A., Ardizzone, L., & Köthe, U. (2020). BayesFlow: Learning complex stochastic models with invertible neural networks. IEEE Transactions on Neural Networks and Learning Systems, available for free at:
https://arxiv.org/abs/2003.06281
The general workflow (training and inference phase) with BayesFlow is illustrated below.
Currently, the following training approaches are implemented:
- Online training
- Offline training (external simulations)
- Offline training (internal simulations)
- Experience replay
- Round-based training
In order to ensure algorithmic alignment between the neural approximator and the computational model (simulator), we recommend the following neural architectural considerations:
Stateless models typically generate IID observations, which imply exchangeability and induce permutation invariant posteriors. In other words, changing (permuting) the order of individual elements should not change the associated likelihood or posterior. An example BayesFlow architecture for tackling stateless models is depicted below.
You can read more about designing invariant networks in the excellent paper by Benjamin Bloem-Reddy and Yee Whye Teh, available at https://arxiv.org/abs/1901.06082.
Stateful models incorporate some form of memory and are thus capable of generating observations with complex dependencies (i.e., non-IID). A prime example are dynamic models, which typically describe the evolution trajectory of a system or a process, such as an infectious disease, over time. Observations generated from such models are usually the solution of a stochastic differential equation(SDE) or time-series and thus imply a more complex probabilistic symmetry than those generated from memoryless models. An example BayesFlow architecture for tackling stateful models is depicted below.
We used the above architecture for modeling the early Covid-19 outbreak in Germany: https://arxiv.org/abs/2010.00300.
Joint models present an attempt to account for different processes (e.g., neural and cognitive) within a single composite model. Thus, joint models integrate different sources and types of data and require morec omplex summary architectures. An example BayesFlow architecture for three hypothetical data sources is depicted below.
The algorithm for model comparison is based on our paper:
Radev, S. T., D'Alessandro, M., Mertens, U. K., Voss, A., & Köthe, U.,Bürkner, P. C. (2020). Amortized bayesian model comparison with evidential deep learning. arXiv preprint arXiv:2004.10629, available for free at: