Standardize#
- class myoverse.transforms.Standardize(mean, std, eps=1e-08, **kwargs)[source]#
Standardize using pre-computed mean and std.
Useful when you have statistics from the training set.
- Parameters:
mean (float | torch.Tensor) – Mean value(s) to subtract.
std (float | torch.Tensor) – Standard deviation(s) to divide by.
eps (float) – Small value to avoid division by zero.
Examples
>>> # Compute stats on training data >>> train_mean = train_data.mean() >>> train_std = train_data.std() >>> >>> # Apply to test data >>> standardize = Standardize(mean=train_mean, std=train_std) >>> test_normalized = standardize(test_data)
Methods