Take#

class bayesflow.adapters.transforms.Take(indices: Sequence[int], axis: int = -1)[source]#

Bases: ElementwiseTransform

A transform to reduce the dimensionality of arrays output by the summary network Example: adapter.take(“x”, np.arange(0,3), axis=-1)

forward(data: Tensor, **kwargs) → Tensor[source]#
inverse(data: Tensor, **kwargs) → Tensor[source]#
get_config() → dict[source]#
__call__(data: Tensor, inverse: bool = False, **kwargs) → Tensor#

Call self as a function.

classmethod from_config(config: dict, custom_objects=None)#
has_permutation_jacobian: ClassVar[bool] = False#

Whether the transform only moves values around, i.e., has a permutation Jacobian.

log_det_jac(data: Tensor, inverse: bool = False, **kwargs) → Tensor | None#