OneHot#

class bayesflow.adapters.transforms.OneHot(num_classes: int)[source]#

Bases: ElementwiseTransform

Changes data to be one-hot encoded.

Parameters:
num_classesint

Number of classes for the encoding.

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

Call self as a function.

classmethod from_config(config: dict, custom_objects=None)#
log_det_jac(data: ndarray, inverse: bool = False, **kwargs) → ndarray | None#