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:
- denoiser
func Denoiser (must be a function with one input corresponding to the signal to be denoised)
- dims
tuple Dimensions used to reshape the vector
xin thedenoisermethod prior to applying the denoiser- sigma
float, optional Multiplicative coefficient of RED term
- sigmad
floatorfunc, 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
gradorproxmethods has been invoked before and returns a scalar (or a list of)sigmato be used- x0
numpy.ndarray, optional Initial vector of iterative scheme used to compute the proximal
- niter
int, optional Number of iterations of iterative scheme used to compute the proximal
- warm
bool, optional Warm start (
True) or not (False). Uses estimate from previous call ofproxmethod.- call
bool, optional Evalutate call method (
True) or not (False)
- denoiser
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)