torchlib.layerfunction package

Submodules

torchlib.layerfunction.complex_functions module

@author: spopoff

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

torchlib.layerfunction.cplxfunc module

torchlib.layerfunction.cplxfunc.csign(x, caxis=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

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

Returns

The output.

Return type

tensor

Raises

TypeErrorcaxis should be integer!

torchlib.layerfunction.cplxfunc.csoftshrink(x, alpha=0.5, caxis=None, inplace=False)

Complex soft shrink function

Parameters
  • x (tensor) – The input.

  • alpha (float, optional) – The threshhold.

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

Returns

The output.

Return type

tensor

Raises

TypeErrorcaxis should be integer!

torchlib.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