normalize_signal#

deepinv.utils.normalize_signal(inp, *, mode, vmin=None, vmax=None)[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. If clip is selected, the values of vmin and vmax are used as clipping bounds if provided, otherwise the default bounds of 0.0 and 1.0 are used. 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.

Return type:

Tensor