torchcvnn.transforms¶
Conversion transforms¶
|
Add a singleton dimension to the input array/tensor. |
|
Converts numpy array or torch tensor to torch tensor of specified dtype. |
|
Transform a complex-valued tensor into its real and imaginary components. |
Extracts the imaginary part of a complex-valued input tensor. |
|
|
Extracts the real part of a complex-valued input tensor. |
|
Randomly phase-shifts complex-valued input data. This transform applies a random phase shift to complex-valued input tensors/arrays by multiplying the input with exp(j*phi), where phi is uniformly distributed in [0, 2π] or [-π, π] if centering is enabled. :param dtype: str Data type for the output. Must be one of the supported complex dtypes. :param centering: bool, optional. If True, centers the random phase distribution around 0 by subtracting π from the generated phases. Default is False. |
|
Per-channel 2x2 normalization of [Re, Im]. This transform normalizes complex-valued input data by centering and scaling it. It supports both numpy arrays and PyTorch tensors as input. :param means: Per-channel means for centering. Shape (C, 2) where C is number of channels. :type means: array-like :param covs: Per-channel 2x2 covariance matrices for scaling. Shape (C, 2, 2). Covariance matrices must be symmetric positive definite. :type covs: array-like. |
Complex transforms¶
|
This transform applies a logarithmic scaling to the amplitude/magnitude of complex values while optionally preserving the phase information. |
|
Transform a complex-valued tensor into its amplitude/magnitude. |
|
Randomly phase-shifts complex-valued input data. This transform applies a random phase shift to complex-valued input tensors/arrays by multiplying the input with exp(j*phi), where phi is uniformly distributed in [0, 2π] or [-π, π] if centering is enabled. :param dtype: str Data type for the output. Must be one of the supported complex dtypes. :param centering: bool, optional. If True, centers the random phase distribution around 0 by subtracting π from the generated phases. Default is False. |
Resize transforms¶
|
Resize a complex tensor to a given size. |
|
Resizes an input image in spectral domain with Fourier Transformations. |
|
Center crops an input array/tensor to the specified size. |
|
Pad an image if its dimensions are smaller than specified minimum dimensions. |