grelu.transforms.label_transforms#
Classes that perform transformations on labels
The input to the forward method is assumed to be a numpy array of shape (N, T, L)
Classes#
A class to transform sequence labels. |
Module Contents#
- class grelu.transforms.label_transforms.LabelTransform(min_clip: int | None = None, max_clip: int | None = None, transform_func: str | Callable | None = None)[source]#
A class to transform sequence labels.
- Parameters:
min_thresh – Minimum allowed value. Elements with value less than this will be clipped to min_thresh.
max_thresh – Maximum allowed value. Elements with value greater than this will be clipped to max_thresh
transform_func – A function or name of a function that transforms the label values. Allowed names are “log”.
- forward(label: numpy.ndarray) numpy.ndarray [source]#
Apply the transformation.
- Parameters:
label – numpy array of shape (B, T, L)
- Returns:
Transformed label
- __call__(label: numpy.ndarray) numpy.ndarray [source]#