NaiveNormalize#
- class torch_ecg._preprocessors.NaiveNormalize(mean: float | int | ndarray[Any, dtype[_ScalarType_co]] = 0.0, std: float | int | ndarray[Any, dtype[_ScalarType_co]] = 1.0, per_channel: bool = False, **kwargs: Any)[source]#
Bases:
NormalizeNaive normalization.
Naive normalization defined as
\[\frac{sig - m}{s}\]- Parameters:
mean (float or int or numpy.ndarray, default 0.0) – Value(s) to be subtracted.
std (float or int or numpy.ndarray, default 1.0) – Value(s) to be divided.
per_channel (bool, default False) – If True, normalization will be done per channel.
Examples
from torch_ecg.cfg import DEFAULTS sig = DEFAULTS.RNG.randn(1000) pp = NaiveNormalize() sig, _ = pp(sig, 500)