msi2slstr.transform.normalization¶
Data normalization module.
Classes
|
Class to normalize given array according to the normalizer state, always in a channelwise manner. |
|
Class to standardize given array in a channelwise manner. |
- class msi2slstr.transform.normalization.Normalizer(offset: tuple[float], scale: tuple[float], *, e: float = 1e-15)[source]¶
Bases:
object
Class to normalize given array according to the normalizer state, always in a channelwise manner. i.e. Each channel (dim 1) of the array is normalized independently.
\[A_{\mathrm{normal}} = \frac{(A - offset)} {(scale + \varepsilon)}\]- Parameters:
offset (tuple[float]) – A tuple of floats with the per channel value by which to offset the provided array’s value range. Has to be broadcastable to the array’s shape.
scale (tuple[int]) – A tuple of floats with the per channel value to scale the array’s value range. Has to be broadcastable to the array’s shape.
e (float, optional) – A small constant added to the denominator to avoid division by 0, defaults to 1e-15.
- class msi2slstr.transform.normalization.Standardizer(dims: tuple[int] = None, *, e: float = 1e-15)[source]¶
Bases:
object
Class to standardize given array in a channelwise manner.
\[A_{\mathrm{standard}} = \frac{(A - \bar{A})}{(\sigma_A + \varepsilon)}\]- Parameters:
dims (tuple[int], optional) – A tuple of ints indicating the dimensions to collapse.
e (float, optional) – A small constant added to the denominator to avoid division by 0, defauts to 1e-15.