Source code for bayesflow.adapters.transforms.elementwise_transform
from keras.saving import register_keras_serializable as serializable
import numpy as np
[docs]
@serializable(package="bayesflow.adapters")
class ElementwiseTransform:
"""Base class on which other transforms are based"""
[docs]
def __call__(self, data: np.ndarray, inverse: bool = False, **kwargs) -> np.ndarray:
if inverse:
return self.inverse(data, **kwargs)
return self.forward(data, **kwargs)
[docs]
@classmethod
def from_config(cls, config: dict, custom_objects=None) -> "ElementwiseTransform":
raise NotImplementedError