Magnitude Masking Layers

class complextorch.nn.modules.mask.ComplexRatioMask

Complex Ratio Mask

\[\texttt{ComplexRatioMask}(\mathbf{z}) = \texttt{Sigmoid}(|\mathbf{z}|) \odot \frac{\mathbf{z}}{|\mathbf{z}|}\]

Retains phase and squeezes magnitude using sigmoid function.

Based on work from the following paper:

HW Cho, S Choi, YR Cho, and J Kim: Complex-Valued Channel Attention and Application in Ego-Velocity Estimation With Automotive Radar

forward(input: CVTensor) CVTensor

Computes complex ratio mask on complex-valued input tensor.

Parameters:

input (CVTensor) – input tensor

Returns:

\(\text{sigmoid}(|\mathbf{z}|) * \mathbf{z} / |\mathbf{z}|\)

Return type:

CVTensor

class complextorch.nn.modules.mask.MagMinMaxNorm(dim: int | None = None)

Magnitude Min-Max Normalization Layer

Applies the min-max norm to the input tensor yielding an output whose magnitude is normalized between 0 and 1 over the specified dimension while phase information remains unchanged.

Implements the following operation:

\[\texttt{MagMinMaxNorm}(\mathbf{z}) = \frac{\mathbf{z} - \mathbf{z}_{min}}{\mathbf{z}_{max} - \mathbf{z}_{min}}\]
forward(input: CVTensor) CVTensor

Applies the min-max norm to the input tensor yielding an output whose magnitude is normalized between 0 and 1 over the specified dimension while phase information remains unchanged.

Parameters:

input (CVTensor) – input tensor

Returns:

\(\frac{\mathbf{z} - \mathbf{z}_{min}}{\mathbf{z}_{max} - \mathbf{z}_{min}}\)

Return type:

CVTensor

class complextorch.nn.modules.mask.PhaseSigmoid(*args, **kwargs)

Phase-Preserving Complex-Valued Sigmoid Layer

\[\texttt{ComplexRatioMask}(\mathbf{z}) = \texttt{Sigmoid}(|\mathbf{z}|) \odot \frac{\mathbf{z}}{|\mathbf{z}|}\]

Retains phase and squeezes magnitude using sigmoid function.

Based on work from the following paper:

HW Cho, S Choi, YR Cho, and J Kim: Complex-Valued Channel Attention and Application in Ego-Velocity Estimation With Automotive Radar