pylops.optimization.sparsity.irls#
- pylops.optimization.sparsity.irls(Op, y, x0=None, nouter=10, threshR=False, epsR=1e-10, epsI=1e-10, tolIRLS=1e-10, warm=False, kind='data', show=False, itershow=(10, 10, 10), callback=None, **kwargs_solver)[source]#
Iteratively reweighted least squares.
Solve an optimization problem with \(L_1\) cost function (data IRLS) or \(L_1\) regularization term (model IRLS) given the operator
Op
and datay
.In the data IRLS, the cost function is minimized by iteratively solving a weighted least squares problem with the weight at iteration \(i\) being based on the data residual at iteration \(i-1\). This IRLS solver is robust to outliers since the L1 norm given less weight to large residuals than L2 norm does.
Similarly in the model IRLS, the weight at at iteration \(i\) is based on the model at iteration \(i-1\). This IRLS solver inverts for a sparse model vector.
- Parameters
- Op
pylops.LinearOperator
Operator to invert
- y
numpy.ndarray
Data
- x0
numpy.ndarray
, optional Initial guess
- nouter
int
, optional Number of outer iterations
- threshR
bool
, optional Apply thresholding in creation of weight (
True
) or damping (False
)- epsR
float
, optional Damping to be applied to residuals for weighting term
- epsI
float
, optional Tikhonov damping
- tolIRLS
float
, optional Tolerance. Stop outer iterations if difference between inverted model at subsequent iterations is smaller than
tolIRLS
- warm
bool
, optional Warm start each inversion inner step with previous estimate (
True
) or not (False
). This only applies tokind="data"
andkind="datamodel"
- kind
str
, optional Kind of solver (
model
,data
ordatamodel
)- show
bool
, optional Display logs
- itershow
tuple
, 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.
- callback
callable
, optional Function with signature (
callback(x)
) to call after each iteration wherex
is the current model vector- **kwargs_solver
Arbitrary keyword arguments for
scipy.sparse.linalg.cg
solver for data IRLS andscipy.sparse.linalg.lsqr
solver for model IRLS when using numpy data(orpylops.optimization.solver.cg
andpylops.optimization.solver.cgls
when using cupy data)
- Op
- Returns
- xinv
numpy.ndarray
Inverted model
- nouter
int
Number of effective outer iterations
- xinv
Notes