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.
- log_det_jac(data: dict[str, any], log_det_jac: dict[str, any], inverse: bool = False, **kwargs)[source]#