pyproximal.RED

class pyproximal.RED(denoiser: Callable[[ndarray[tuple[Any, ...], dtype[_ScalarT]], float], ndarray[tuple[Any, ...], dtype[_ScalarT]]], dims: Tuple[int, ...], sigma: float = 1.0, sigmad: float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | Callable[[int], float | ndarray[tuple[Any, ...], dtype[_ScalarT]]] = 1.0, x0: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None, niter: int = 10, warm: bool = True, call: bool = True)[source]

Regularization by Denoising (RED)

Regularization by Denoising loss [1]: \(RED(\mathbf{x}) = \sigma\mathbf{x}^T (\mathbf{x} - f_{\sigma_d}(\mathbf{x}))\)

Parameters:
denoiserfunc

Denoiser (must be a function with one input corresponding to the signal to be denoised)

dimstuple

Dimensions used to reshape the vector x in the denoiser method prior to applying the denoiser

sigmafloat, optional

Multiplicative coefficient of RED term

sigmadfloat or func, optional

Strenght of the denoiser. This can be a constant number or a function that is called passing a counter which keeps track of how many times the grad or prox methods has been invoked before and returns a scalar (or a list of) sigma to be used

x0numpy.ndarray, optional

Initial vector of iterative scheme used to compute the proximal

niterint, optional

Number of iterations of iterative scheme used to compute the proximal

warmbool, optional

Warm start (True) or not (False). Uses estimate from previous call of prox method.

callbool, optional

Evalutate call method (True) or not (False)

Notes

The gradient of the RED loss is defined as:

\[\nabla_\mathbf{x} RED(\mathbf{x}) = \sigma (\mathbf{x} - f_{\sigma_d}(\mathbf{x}))\]

whilst the proximal operator is obtained by solving the minimization problem

\[prox_{\tau RED} (\mathbf{x}) = \argmin_{\mathbf{y}} RED(\mathbf{y}) + \frac{1}{2 \tau}||\mathbf{y} - \mathbf{x}||^2_2\]

via the following fixed-point iteration:

\[\mathbf{y}^k = \frac{1}{\beta + \sigma} (\sigma f_{\sigma_d}(\mathbf{y}^{k-1}) + \beta \mathbf{x})\]

where \(\beta=1/\tau\).

References

[1]

Romano, Y., Elad, M., and Milanfar, P. “The Little Engine that Could Regularization by Denoising (RED)”, SIAM Journal on Imaging Science. 2017.

Methods

__init__(denoiser, dims[, sigma, sigmad, ...])

affine_addition(v)

Affine addition

chain(g)

Chain

grad(*args, **kwargs)

Gradient of the Moreau envelope of the function.

postcomposition(sigma)

Postcomposition

precomposition(a, b)

Precomposition

prox(*args, **kwargs)

proxdual(**kwargs)

Examples using pyproximal.RED

Regularization by Denoising (RED)

Regularization by Denoising (RED)