KerasTransform#
- class bayesflow.adapters.transforms.KerasTransform(forward: str, inverse: str = None)[source]#
Bases:
ElementwiseTransformA class to apply element-wise transformations using named keras.ops functions.
- Attributes:
- _forwardstr
The name of the keras.ops function to apply in the forward transformation.
- _inversestr
The name of the keras.ops function to apply in the inverse transformation.
Initializes the KerasTransform with specified forward and inverse functions.
- Parameters:
- forwardstr
The name of the keras.ops function to use for the forward transformation.
- inversestr, optional
The name of the keras.ops function to use for the inverse transformation. By default, the inverse is inferred from the forward argument for supported methods.
- INVERSE_METHODS = {'arctan': 'tan', 'exp': 'log', 'expm1': 'log1p', 'log': 'exp', 'log1p': 'expm1', 'reciprocal': 'reciprocal', 'sqrt': 'square', 'square': 'sqrt', 'tan': 'arctan'}#
Dict of function names that support automatic selection of their inverse.