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 _gradprox method must be used (instead of grad) 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, the fun and grad methods will be called instead and their results returned.

Parameters:
x0numpy.ndarray

Initial vector

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.

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 optimize method.

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)

Examples using pyproximal.Nonlinearยถ

Nonlinear inversion with box constraints

Nonlinear inversion with box constraints