Shortcuts

Normalize

class torchtime.transforms.Normalize(mean: Tuple[float], std: Tuple[float], inplace: bool = False)[source]

Normalize a tensor time series with mean and standard deviation. Given mean: (mean[1],...,mean[n]) and std: (std[1],..,std[n]) for n channels, this transform will normalize each channel of the input torch.*Tensor i.e., output[channel] = (input[channel] - mean[channel]) / std[channel]

Note

This transform acts out of place, i.e., it does not mutate the input tensor.

Parameters:
  • mean (tuple) – Sequence of means for each channel.

  • std (tuple) – Sequence of standard deviations for each channel.

  • inplace (bool,optional) – Bool to make this operation in-place.

forward(tensor: Tensor) Tensor[source]
Parameters:

tensor (Tensor) – Tensor time series to be normalized.

Returns:

Normalized Tensor series.

Return type:

Tensor