timesead.data.transforms.transform_base
Classes
Base class for all transforms. |
Module Contents
- class timesead.data.transforms.transform_base.Transform(parent: Transform | None)
Bases:
abc.ABCBase class for all transforms. A Transform processes one (or several) data points and outputs them. Transforms can be chained in a pull-based pipeline.
- Parameters:
parent (Optional[Transform]) – Another
Transformwhich is used as the data source for thisTransform. Can be None in the case of a source.
- parent
- get_datapoint(item: int) Tuple[Tuple[torch.Tensor, Ellipsis], Tuple[torch.Tensor, Ellipsis]]
Returns a datapoint (in our case this is a sequence) from this transform.
- Parameters:
item (int) – Must be 0<=item<len(self)
- Returns:
A datapoint of the form (inputs, targets), where inputs and targets are tuples of tensors.
- Return type:
Tuple[Tuple[torch.Tensor, Ellipsis], Tuple[torch.Tensor, Ellipsis]]
- __len__() int | None
This should return the number of available sequences after the transformation.
- Return type:
Optional[int]