MedianFilter#

class deepinv.models.MedianFilter(kernel_size=9, padding=0, same=True)[source]#

Bases: Denoiser

Median filter.

It computes the median value of a sliding window over the input tensor. The window is defined by the kernel size.

Parameters:
  • kernel_size (int) – size of pooling kernel, int or 2-tuple

  • padding – pool padding, int or 4-tuple (l, r, t, b) as in pytorch F.pad

  • same – override padding and enforce same padding, boolean

forward(x, sigma=None, **kwargs)[source]#

Applies denoiser \(\denoiser{x}{\sigma}\).

Parameters:
Returns:

(torch.Tensor) Denoised tensor.

Examples using MedianFilter:#

Image transforms for equivariance & augmentations

Image transforms for equivariance & augmentations

Building your custom sampling algorithm.

Building your custom sampling algorithm.