grelu.transforms.label_transforms#
grelu.transforms.label_transform contains classes that perform transformations on labels - for example, sequencing coverage values or other values used to train sequence-to-function deep learning models. This allows users to transform the labels at training time in ways that make training easier.
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]#