pyproximal.Nonlinear#
- class pyproximal.Nonlinear(x0: ndarray[tuple[Any, ...], dtype[_ScalarT]], niter: int = 10, warm: bool = True)[source]#
Nonlinear function proximal operator.
Proximal operator for a generic nonlinear function \(f\). This is a template class which a user must subclass and implement the following methods:
fun: a method evaluating the generic function \(f\).grad: a method evaluating the gradient of the generic function \(f\).optimize: a method that solves the optimization problem associated with the proximal operator of \(f\). Note that the_gradproxmethod must be used (instead ofgrad) as this will automatically add the regularization term involved in the evaluation of the proximal operator.
and optionally:
fungrad: a method evaluating both the generic function \(f\) and its gradient. If not implemented, thefunandgradmethods will be called instead and their results returned.
- Parameters
Notes
The proximal operator of a generic function requires solving the following optimization problem numerically
\[prox_{\tau f} (\mathbf{x}) = arg \; min_{\mathbf{y}} f(\mathbf{y}) + \frac{1}{2 \tau}||\mathbf{y} - \mathbf{x}||^2_2\]which is done via the provided
optimizemethod.Methods
__init__(x0[, niter, warm])affine_addition(v)Affine addition
chain(g)Chain
fun(x)fungrad(x)grad(x)Gradient of the Moreau envelope of the function.
optimize()postcomposition(sigma)Postcomposition
precomposition(a, b)Precomposition
prox(**kwargs)proxdual(**kwargs)