Skip to content

Commit ec61454

Browse files
Merge pull request #115 from stefanradev93/Development
Merge with dev
2 parents fda4479 + 3d1d792 commit ec61454

15 files changed

+167
-87
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# BayesFlow <img src="https://github.com/stefanradev93/BayesFlow/blob/master/img/bayesflow_hex.png?raw=true" align="right" width=20% height=20% />
22

33
[![Actions Status](https://github.com/stefanradev93/bayesflow/workflows/Tests/badge.svg)](https://github.com/stefanradev93/bayesflow/actions)
4-
[![Licence](https://img.shields.io/github/license/stefanradev93/BayesFlow)](https://img.shields.io/github/license/stefanradev93/BayesFlow)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-red.svg)](https://opensource.org/licenses/MIT)
55
[![DOI](https://joss.theoj.org/papers/10.21105/joss.05702/status.svg)](https://doi.org/10.21105/joss.05702)
6+
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/dwyl/esta/issues)
7+
68

79
Welcome to our BayesFlow library for efficient simulation-based Bayesian workflows! Our library enables users to create specialized neural networks for *amortized Bayesian inference*, which repay users with rapid statistical inference after a potentially longer simulation-based training phase.
810

bayesflow/computational_utilities.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def posterior_calibration_error(
5151
The random draws from the approximate posteriors over ``num_datasets``
5252
prior_samples : np.ndarray of shape (num_datasets, num_params)
5353
The corresponding ground-truth values sampled from the prior
54-
alpha_resolution : int, optional, default: 100
54+
alpha_resolution : int, optional, default: 20
5555
The number of credibility intervals (CIs) to consider
5656
aggregator_fun : callable or None, optional, default: np.median
5757
The function used to aggregate the marginal calibration errors.
@@ -233,7 +233,7 @@ def mmd_kernel_unbiased(x, y, kernel):
233233
Returns
234234
-------
235235
loss : tf.Tensor of shape (,)
236-
The statistically unbiaserd squared maximum mean discrepancy (MMD) value.
236+
The statistically unbiased squared maximum mean discrepancy (MMD) value.
237237
"""
238238

239239
m, n = x.shape[0], y.shape[0]

bayesflow/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
class DefaultJointConfigurator:
29-
"""Fallback class for a generic configrator for joint posterior and likelihood approximation."""
29+
"""Fallback class for a generic configurator for joint posterior and likelihood approximation."""
3030

3131
def __init__(self, default_float_type=np.float32):
3232
self.posterior_config = DefaultPosteriorConfigurator(default_float_type=default_float_type)

bayesflow/coupling_networks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def _calculate_spline(self, target, spline_params, inverse=False):
313313
target : tf.Tensor of shape (batch_size, ..., dim_2)
314314
The target partition of the input vector to transform.
315315
spline_params : tuple(tf.Tensor,...)
316-
A tuple with tensors corresponding to the learnbale spline features:
316+
A tuple with tensors corresponding to the learnable spline features:
317317
(left_edge, bottom_edge, widths, heights, derivatives)
318318
inverse : bool, optional, default: False
319319
Flag indicating whether to run the block forward or backward.
@@ -516,7 +516,7 @@ def __init__(
516516
for the required entries.
517517
coupling_design : str or callable, optional, default: 'affine'
518518
The type of internal coupling network to use. Must be in ['affine', 'spline'].
519-
In general, spline couplings run slower than affine couplings, but require fewers coupling
519+
In general, spline couplings run slower than affine couplings, but requires fewer coupling
520520
layers. Spline couplings may work best with complex (e.g., multimodal) low-dimensional
521521
problems. The difference will become less and less pronounced as we move to higher dimensions.
522522
permutation : str or None, optional, default: 'fixed'
@@ -581,15 +581,15 @@ def __init__(
581581
self.act_norm = None
582582

583583
def call(self, target_or_z, condition, inverse=False, **kwargs):
584-
"""Performs one pass through a the affine coupling layer (either inverse or forward).
584+
"""Performs one pass through the affine coupling layer (either inverse or forward).
585585
586586
Parameters
587587
----------
588588
target_or_z : tf.Tensor
589-
The estimation quantites of interest or latent representations z ~ p(z), shape (batch_size, ...)
589+
The estimation quantities of interest or latent representations z ~ p(z), shape (batch_size, ...)
590590
condition : tf.Tensor or None
591591
The conditioning data of interest, for instance, x = summary_fun(x), shape (batch_size, ...).
592-
If `condition is None`, then the layer recuces to an unconditional ACL.
592+
If `condition is None`, then the layer reduces to an unconditional ACL.
593593
inverse : bool, optional, default: False
594594
Flag indicating whether to run the block forward or backward.
595595

bayesflow/default_settings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,8 @@ def __init__(self, meta_dict: dict, mandatory_fields: list = []):
199199

200200

201201
MMD_BANDWIDTH_LIST = [1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1, 1, 5, 10, 15, 20, 25, 30, 35, 100, 1e3, 1e4, 1e5, 1e6]
202+
203+
# Minimum time interval between tqdm status updates to reduce
204+
# load. Only respected when refresh=False in set_postfix
205+
# and set_postfix_str
206+
TQDM_MININTERVAL = 0.1 # in seconds

0 commit comments

Comments
 (0)