ml4gw.transforms.scaler
Classes
|
Scale timeseries channels to be zero mean unit variance |
- class ml4gw.transforms.scaler.ChannelWiseScaler(num_channels=None)
Bases:
FittableTransformScale 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=Truekeyword 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 (
int|None) -- The number of channels of the target timeseries. If left asNone, 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
Xand sets these values to themeanandstdparameters 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)