pyproximal.optimization.primal.ProximalGradientยถ

pyproximal.optimization.primal.ProximalGradient(proxf: ProxOperator, proxg: ProxOperator, x0: ndarray[tuple[Any, ...], dtype[_ScalarT]], epsg: float | ndarray[tuple[Any, ...], dtype[_ScalarT]] = 1.0, tau: float | None = None, backtracking: bool = False, beta: float = 0.5, eta: float = 1.0, niter: int = 10, niterback: int = 100, acceleration: str | None = None, tol: float | None = None, rtol: float | None = None, callback: Callable[[ndarray[tuple[Any, ...], dtype[_ScalarT]]], None] | None = None, show: bool = False, itershow: tuple[int, int, int] = (10, 10, 10)) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]ยถ

Proximal gradient (optionally accelerated)

Solves the following minimization problem using (Accelerated) Proximal gradient algorithm:

\[\mathbf{x} = \argmin_\mathbf{x} f(\mathbf{x}) + \epsilon g(\mathbf{x})\]

where \(f(\mathbf{x})\) is a smooth convex function with a uniquely defined gradient and \(g(\mathbf{x})\) is any convex function that has a known proximal operator.

Parameters:
proxfpyproximal.ProxOperator

Proximal operator of f function (must have grad implemented)

proxgpyproximal.ProxOperator

Proximal operator of g function

x0numpy.ndarray

Initial vector

epsgfloat or numpy.ndarray, optional

Scaling factor of g function. Can be a scalar for iteration-independent scaling or a a 1d vector for iteration-dependent scaling

taufloat or numpy.ndarray, optional

Positive scalar weight, which should satisfy the following condition to guarantees convergence: \(\tau \in (0, 1/L]\) where L is the Lipschitz constant of \(\nabla f\). When tau=None, backtracking is used to adaptively estimate the best tau at each iteration. Finally, note that \(\tau\) can be chosen to be a vector when dealing with problems with multiple right-hand-sides

backtrackingbool, optional

Force backtracking, even if tau is not equal to None. In this case the chosen tau will be used as the initial guess in the first step of backtracking

betafloat, optional

Backtracking parameter (must be between 0 and 1)

etafloat, optional

Relaxation parameter (must be between 0 and 1, 0 excluded).

niterint, optional

Number of iterations of iterative scheme

niterbackint, optional

Max number of iterations of backtracking

accelerationstr, optional

Acceleration (None, vandenberghe or fista)

tolfloat, optional

Tolerance on change of objective function (used as stopping criterion). If tol=None, run until niter is reached or the other tolerance criterion is met

rtolfloat, optional

Relative tolerance on objective function wrt initial value. Stops the solver when the ratio of the current objective function to the initial objective function is below this value. If rtol=None, run until niter is reached or the other tolerance criterion is met

callbackcallable, optional

Function with signature (callback(x)) to call after each iteration where x is the current model vector

showbool, optional

Display iterations log

itershowtuple, optional

Display set log for the first N1 steps, last N2 steps, and every N3 steps in between where N1, N2, N3 are the three element of the list.

Returns:
xnumpy.ndarray

Inverted model

Notes

See pyproximal.optimization.cls_primal.ProximalGradient

Examples using pyproximal.optimization.primal.ProximalGradientยถ

Denoising

Denoising

Group sparsity

Group sparsity

IHT, ISTA, FISTA, AA-ISTA, and TWIST for Compressive sensing

IHT, ISTA, FISTA, AA-ISTA, and TWIST for Compressive sensing

Low-Rank completion via SVD

Low-Rank completion via SVD

Nonlinear inversion with box constraints

Nonlinear inversion with box constraints

Plug and Play Priors

Plug and Play Priors

Quadratic program with box constraints

Quadratic program with box constraints