ConvertDType#

class bayesflow.adapters.transforms.ConvertDType(from_dtype: str, to_dtype: str)[source]#

Bases: ElementwiseTransform

Default transform used to convert all floats from float64 to float32 to be in line with keras framework.

Parameters:
from_dtypestr

Original dtype

to_dtypestr

Target dtype

has_permutation_jacobian: ClassVar[bool] = True#

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

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

Call self as a function.

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