bayesflow.configuration module#

class bayesflow.configuration.DefaultJointConfigurator(default_float_type=<class 'numpy.float32'>)[source]#

Bases: object

Fallback class for a generic configurator for joint posterior and likelihood approximation.

__init__(default_float_type=<class 'numpy.float32'>)[source]#
__call__(forward_dict)[source]#

Configures the outputs of a generative model for joint learning.

class bayesflow.configuration.DefaultLikelihoodConfigurator(default_float_type=<class 'numpy.float32'>)[source]#

Bases: object

Fallback class for a generic configrator for amortized likelihood approximation.

__init__(default_float_type=<class 'numpy.float32'>)[source]#
__call__(forward_dict)[source]#

Configures the output of a generative model for likelihood estimation.

class bayesflow.configuration.DefaultCombiner[source]#

Bases: object

Fallback class for a generic combiner of conditions.

__call__(forward_dict)[source]#

Converts all condition-related variables or fails.

class bayesflow.configuration.DefaultPosteriorConfigurator(default_float_type=<class 'numpy.float32'>)[source]#

Bases: object

Fallback class for a generic configrator for amortized posterior approximation.

__init__(default_float_type=<class 'numpy.float32'>)[source]#
__call__(forward_dict)[source]#

Processes the forward dict to configure the input to an amortizer.

class bayesflow.configuration.DefaultModelComparisonConfigurator(num_models, combiner=None, default_float_type=<class 'numpy.float32'>)[source]#

Bases: object

Fallback class for a default configurator for amortized model comparison.

__init__(num_models, combiner=None, default_float_type=<class 'numpy.float32'>)[source]#
__call__(forward_dict)[source]#

Convert all variables to arrays and combines them for inference into a dictionary with the following keys, if DEFAULT_KEYS dictionary unchanged:

model_indices - a list of model indices, e.g., if two models, then [0, 1] model_outputs - a list of dictionaries, e.g., if two models, then [dict0, dict1]