ml4gw.transforms.scaler

Classes

ChannelWiseScaler([num_channels])

Scale timeseries channels to be zero mean unit variance

class ml4gw.transforms.scaler.ChannelWiseScaler(num_channels=None)

Bases: FittableTransform

Scale timeseries channels to be zero mean unit variance

Scales timeseries channels by the mean and standard deviation of the channels of the timeseries used to fit the module. To reverse the scaling, provide the reverse=True keyword argument at call time. By default, the scaling parameters are set to zero mean and unit variance, amounting to an identity transform.

Parameters:

num_channels (Optional[int]) -- The number of channels of the target timeseries. If left as None, the timeseries will be assumed to be 1D (single channel).

fit(X, std_reg=0.0)

Fit the scaling parameters to a timeseries

Computes the channel-wise mean and standard deviation of the timeseries X and sets these values to the mean and std parameters of the scaler.

Return type:

None

Parameters:
  • X (Float[Tensor, '... time'])

  • std_reg (float | None)

forward(X, reverse=False)
Return type:

time']

Parameters:
  • X (Float[Tensor, '... time'])

  • reverse (bool)