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', engine='scipy', show=False, itershow=(10, 10, 10), callback=None, preallocate=False, **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
Opand 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,dataordatamodel)- engine
str, optional Solver to use (
scipyorpylops)- 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 wherexis the current model vector- preallocate
bool, optional New in version 2.6.0.
Pre-allocate all variables used by the solver. Note that if
yis a JAX array, this option is ignored and variables are not pre-allocated since JAX does not support in-place operations.- **kwargs_solver
Arbitrary keyword arguments for
scipy.sparse.linalg.cgsolver for data IRLS andscipy.sparse.linalg.lsqrsolver for model IRLS when using numpy data(orpylops.optimization.solver.cgandpylops.optimization.solver.cglswhen using cupy data)
- Op
- Returns
- xinv
numpy.ndarray Inverted model
- nouter
int Number of effective outer iterations
- xinv
Notes