normalize_signal#

deepinv.utils.normalize_signal(inp, *, mode)[source]#

Normalize a batch of signals between zero and one.

Parameters:
  • inp (torch.Tensor) – the input signal to normalize, it should be of shape (B, *).

  • mode (str) – the normalization, either 'min_max' for min-max normalization or 'clip' for clipping. Note that min-max normalization of constant signals is ill-defined and here it amounts to mapping the constant value to the closest value between zero and one (which is equivalent to clipping).

Returns:

the normalized batch of signals.