torchbox.layerfunction package

Submodules

torchbox.layerfunction.complex_functions module

torchbox.layerfunction.complex_functions.complex_dropout(input, p=0.5, training=True, inplace=False)
torchbox.layerfunction.complex_functions.complex_dropout2d(input, p=0.5, training=True, inplace=False)
torchbox.layerfunction.complex_functions.complex_leaky_relu(input, negative_slope=(0.01, 0.01), inplace=False)
torchbox.layerfunction.complex_functions.complex_max_pool1d(input, kernel_size, stride=None, padding=0, dilation=1, ceil_mode=False, return_indices=False)
torchbox.layerfunction.complex_functions.complex_max_pool2d(input, kernel_size, stride=None, padding=0, dilation=1, ceil_mode=False, return_indices=False)
torchbox.layerfunction.complex_functions.complex_relu(input, inplace=False)
torchbox.layerfunction.complex_functions.complex_upsample(input, size=None, scale_factor=None, mode='nearest', align_corners=None)

torchbox.layerfunction.cplxfunc module

torchbox.layerfunction.cplxfunc.csign(x, cdim=None)

The signum function like Matlab’s sign

\[{\rm csign}(x+jy) = \frac{x+jy}{\sqrt{x^2+y^2}} \]
Parameters
  • x (Tensor, int, float or complex) – The input

  • cdim (int or None, optional) – Specifies the complex axis..

Returns

The output.

Return type

tensor

Raises

TypeErrorcdim should be integer!

torchbox.layerfunction.cplxfunc.csoftshrink(x, alpha=0.5, cdim=None, inplace=False)

Complex soft shrink function

Parameters
  • x (Tensor) – The input.

  • alpha (float, optional) – The threshhold.

  • cdim (int or None, optional) – Specifies the complex axis.

Returns

The output.

Return type

tensor

Raises

TypeErrorcdim should be integer!

torchbox.layerfunction.cplxfunc.softshrink(x, alpha=0.5, inplace=False)

Real soft shrink function

Parameters
  • x (Tensor) – The input.

  • alpha (float, optional) – The threshhold.

Returns

The output.

Return type

tensor

Module contents