pylops.optimization.cls_basic.CGLS

class pylops.optimization.cls_basic.CGLS(Op, callbacks=None)[source]

Conjugate gradient least squares

Solve an overdetermined system of equations given an operator Op and data y using conjugate gradient iterations.

Parameters:
Oppylops.LinearOperator

Operator to invert of size \([N \times M]\)

Attributes:
ncpmodule

Array module used by the solver (obtained via pylops.utils.backend.get_array_module) ). Available only after setup is called.

isjaxbool

True if the input data is a JAX array. Available only after setup is called and updated at each call to step.

snumpy.ndarray

Temporary vector of size \([N \times 1]\). Available only after setup is called and updated at each call to step.

cnumpy.ndarray

Conjugate direction vector of size \([N \times 1]\). Available only after setup is called and updated at each call to step.

qnumpy.ndarray

Temporary vector of size \([M \times 1]\). Available only after setup is called and updated at each call to step.

c1numpy.ndarray

Pre-allocated vector of size \([N \times 1]\) used in the solver when preallocate=True. Available only after setup is called and updated at each call to step.

x1numpy.ndarray

Pre-allocated vector of size \([M \times 1]\) used in the solver when preallocate=True. Available only after setup is called and updated at each call to step.

rnumpy.ndarray

Residual vector of size \([N \times 1]\) used in the solver when preallocate=True. Available only after setup is called and updated at each call to step.

koldfloat

Squared norm of the residual at previous iteration. Available only after setup is called and updated at each call to step.

costlist

History of the L2 norm of the residual. Available only after setup is called and updated at each call to step.

cost1list

History of the L2 norm of the entire objective function (residual plus regularization). Available only after setup is called and updated at each call to step.

iiterint

Current iteration number. Available only after setup is called and updated at each call to step.

Notes

Minimize the following functional using conjugate gradient iterations:

\[J = || \mathbf{y} - \mathbf{Op}\,\mathbf{x} ||_2^2 + \epsilon^2 || \mathbf{x} ||_2^2\]

where \(\epsilon\) is the damping coefficient.

Methods

__init__(Op[, callbacks])

callback(x, *args, **kwargs)

Callback routine

finalize([show])

Finalize solver

memory_usage([show, unit])

Compute memory usage of the solver

run(x[, niter, show, itershow])

Run solver

setup(y[, x0, niter, damp, tol, ...])

Setup solver

solve(y[, x0, niter, damp, tol, ...])

Run entire solver

step(x[, show])

Run one step of solver