pyproximal.optimization.primaldual.PrimalDualยถ

pyproximal.optimization.primaldual.PrimalDual(proxf: ProxOperator, proxg: ProxOperator, A: LinearOperator, x0: ndarray[tuple[Any, ...], dtype[_ScalarT]], tau: float | ndarray[tuple[Any, ...], dtype[_ScalarT]], mu: float | ndarray[tuple[Any, ...], dtype[_ScalarT]], y0: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None, z: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None, theta: float = 1.0, niter: int = 10, gfirst: bool = True, tol: float | None = None, rtol: float | None = None, callback: Callable[[...], None] | None = None, callbacky: bool = False, returny: bool = False, show: bool = False, itershow: tuple[int, int, int] = (10, 10, 10)) ndarray[tuple[Any, ...], dtype[_ScalarT]] | tuple[ndarray[tuple[Any, ...], dtype[_ScalarT]], ndarray[tuple[Any, ...], dtype[_ScalarT]]][source]ยถ

Primal-dual algorithm

Solves the following (possibly) nonlinear minimization problem using the general version of the first-order primal-dual algorithm:

\[\min_{\mathbf{x} \in X} g(\mathbf{Ax}) + f(\mathbf{x}) + \mathbf{z}^T \mathbf{x}\]

where \(\mathbf{A}\) is a linear operator, \(f\) and \(g\) can be any convex functions that have a known proximal operator.

This functional is effectively minimized by solving its equivalent primal-dual problem (primal in \(f\), dual in \(g\)):

\[\min_{\mathbf{x} \in X} \max_{\mathbf{y} \in Y} \mathbf{y}^T(\mathbf{Ax}) + \mathbf{z}^T \mathbf{x} + f(\mathbf{x}) - g^*(\mathbf{y})\]

where \(\mathbf{y}\) is the so-called dual variable.

Parameters:
proxfpyproximal.ProxOperator

Proximal operator of f function

proxgpyproximal.ProxOperator

Proximal operator of g function

Apylops.LinearOperator

Linear operator of g

x0numpy.ndarray

Initial vector

taufloat or numpy.ndarray

Stepsize of subgradient of \(f\). This can be constant or function of iterations (in the latter cases provided as numpy.ndarray)

mufloat or numpy.ndarray

Stepsize of subgradient of \(g^*\). This can be constant or function of iterations (in the latter cases provided as numpy.ndarray)

y0numpy.ndarray

Initial auxiliary vector. If None, set to zero

znumpy.ndarray, optional

Additional vector

thetafloat

Scalar between 0 and 1 that defines the update of the \(\bar{\mathbf{x}}\) variable - note that theta=0 is a special case that represents the semi-implicit classical Arrow-Hurwicz algorithm

niterint, optional

Number of iterations of iterative scheme

gfirstbool, optional

Apply Proximal of operator g first (True) or Proximal of operator f first (False)

tolfloat, optional

Tolerance on x/y updates (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

callbackybool, optional

Modify callback signature to (callback(x, y)) when callbacky=True

returnybool, optional

Return also y

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

ynumpy.ndarray, optional

Inverted second model, only returned if returny=True

Notes

See pyproximal.optimization.cls_primaldual.PrimalDual

Examples using pyproximal.optimization.primaldual.PrimalDualยถ

Adaptive Primal-Dual

Adaptive Primal-Dual

Basis Pursuit

Basis Pursuit

Denoising

Denoising

Image segmentation

Image segmentation

MRI Imaging and Segmentation of Brain

MRI Imaging and Segmentation of Brain