DownsamplingMatlab#

class deepinv.physics.DownsamplingMatlab(factor=2, kernel='cubic', padding='reflect', antialiasing=True, **kwargs)[source]#

Bases: Downsampling

Downsampling with MATLAB imresize

Downsamples with default MATLAB imresize, using a bicubic kernel, antialiasing and reflect padding.

Wraps imresize from a modified version of the original implementation.

The adjoint is computed using autograd via deepinv.physics.adjoint_function(). This is because imresize with reciprocal of scale is not a correct adjoint. Note however the adjoint is quite slow.

Parameters:
  • factor (int, float) – downsampling factor

  • kernel (str) – MATLAB kernel, supports only cubic for bicubic downsampling.

  • padding (str) – MATLAB padding type, supports only reflect for reflect padding.

  • antialiasing (bool) – whether to perform antialiasing in MATLAB downsampling. Recommended to set to True to match MATLAB.

A(x, factor=None, **kwargs)[source]#

Downsample forward operator

Parameters:
  • x (torch.Tensor) – input image

  • factor (int, float) – downsampling factor. If not None, use this factor and store it as current factor.

A_adjoint(y, factor=None, **kwargs)[source]#

Downsample adjoint operator via autograd.

Parameters:
  • y (torch.Tensor) – input measurement

  • factor (int, float) – downsampling factor. If not None, use this factor and store it as current factor.