NaiveNormalize¶
- class torch_ecg._preprocessors.NaiveNormalize(mean: Real | ndarray = 0.0, std: Real | ndarray = 1.0, per_channel: bool = False, **kwargs: Any)[source]¶
Bases:
Normalize
Naive normalization.
Naive normalization defined as
\[\frac{sig - m}{s}\]- Parameters:
mean (numbers.Real or numpy.ndarray, default 0.0) – Value(s) to be subtracted.
std (numbers.Real 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)