torchcvnn.transforms

Conversion transforms

Unsqueeze(dim)

Add a singleton dimension to the input array/tensor.

ToTensor(dtype)

Converts numpy array or torch tensor to torch tensor of specified dtype.

RealImaginary([dtype])

Transform a complex-valued tensor into its real and imaginary components.

Complex transforms

LogAmplitude([min_value, max_value, keep_phase])

This transform applies a logarithmic scaling to the amplitude/magnitude of complex values while optionally preserving the phase information.

Amplitude(dtype)

Transform a complex-valued tensor into its amplitude/magnitude.

RandomPhase(dtype[, centering])

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

SpatialResize(size)

Resize a complex tensor to a given size.

FFTResize(size[, axis, scale, dtype])

Resizes an input image in spectral domain with Fourier Transformations.