Ungroup#

class bayesflow.adapters.transforms.Ungroup(key: str, prefix: str = '')[source]#

Bases: Transform

Ungroups the the variables in key from a dictionary into individual entries. Most transforms do not support nested structures, so this can be used to flatten a nested structure. It can later on be reassembled using the bayesflow.adapters.transforms.Group transform.

Parameters:
keystr

The name of the variable to ungroup. The variable has to be a dictionary.

prefixstr, optional

An optional common prefix that will be added to the ungrouped variable names. This can be necessary to avoid duplicate names.

get_config() dict[source]#
classmethod from_config(config: dict, custom_objects=None)[source]#
forward(data: dict[str, any], *, strict: bool = True, **kwargs) dict[str, any][source]#
inverse(data: dict[str, any], *, strict: bool = False, **kwargs) dict[str, any][source]#
log_det_jac(data: dict[str, any], log_det_jac: dict[str, any], inverse: bool = False, **kwargs)[source]#
__call__(data: dict[str, ndarray], *, inverse: bool = False, **kwargs) dict[str, ndarray]#

Call self as a function.

extra_repr() str#