pylops.optimization.sparsity.omp¶
- pylops.optimization.sparsity.omp(Op, y, niter_outer=10, niter_inner=40, sigma=0.0001, rtol=0.0, rtol1=0.0, normalizecols=False, Opbasis=None, optimal_coeff=False, engine='scipy', show=False, itershow=(10, 10, 10), callback=None, preallocate=False)[source]¶
Orthogonal Matching Pursuit (OMP).
Solve an optimization problem with \(L^0\) regularization function given the operator
Opand datay. The operator can be real or complex, and should ideally be either square \(N=M\) or underdetermined \(N<M\).- Parameters:
- Op
pylops.LinearOperator Operator to invert
- y
numpy.ndarray Data
- niter_outer
int, optional Number of iterations of outer loop
- niter_inner
int, optional Number of iterations of inner loop. By choosing
niter_inner=0, the Matching Pursuit (MP) algorithm is implemented.- sigma
float, optional Maximum \(L_2\) norm of residual. When smaller stop iterations.
- rtol
float, optional Relative tolerance on residual norm wrt initial residual norm. Stops the solver when the ratio of the current residual norm to the initial residual norm is below this value.
- rtol1
float, optional Relative tolerance on residual norm wrt to data. Stops the solver when the ratio of the current residual norm to the data norm is below this value.
- normalizecols
list, optional Normalize columns (
True) or not (False). Note that this can be expensive as it requires applying the forward operator \(n_{cols}\) times to unit vectors (i.e., containing 1 at position j and zero otherwise); use only when the columns of the operator are expected to have highly varying norms.- Opbasis
pylops.LinearOperator Operator representing the basis functions. If not provided, the entire operator used for inversion Op is used.
- optimal_coeff
bool, optional Estimate optimal coefficient that minimizes the norm of the residual \(\mathbf{r} - c * \mathbf{Op}^j) norm (``True`\)) or use the directly the value from the inner product \(\mathbf{Op}_j^H\,\mathbf{r}_k\).
- engine
str, optional Solver to use (
scipyorpylops)- show
bool, optional Display iterations log
- 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, cols)) to call after each iteration wherexcontains the non-zero model coefficient andcolsare the indices where the current model vector is non-zero- preallocate
bool, optional Added 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.
- Op
- Returns:
- xinv
numpy.ndarray Inverted model
- niter_outer
int Number of effective outer iterations
- cost
numpy.ndarray History of cost function
- xinv
See also
ISTAIterative Shrinkage-Thresholding Algorithm (ISTA).
FISTAFast Iterative Shrinkage-Thresholding Algorithm (FISTA).
SPGL1Spectral Projected-Gradient for L1 norm (SPGL1).
SplitBregmanSplit Bregman for mixed L2-L1 norms.
Notes