MinMaxNormalize

class torch_ecg._preprocessors.MinMaxNormalize(per_channel: bool = False)[source]

Bases: Normalize

Min-Max normalization.

Min-Max normalization defined as

\[\frac{sig - \min(sig)}{\max(sig) - \min(sig)}\]
Parameters:

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 = MinMaxNormalize()
sig, _ = pp(sig, 500)
extra_repr_keys() List[str][source]

Extra keys for __repr__() and __str__().