Record Class CoSaMP
java.lang.Object
java.lang.Record
smile.cs.CoSaMP
- Record Components:
x- the recovered sparse signal (lengthn).support- the indices of the identified non-zero components.iter- the number of iterations performed.
- All Implemented Interfaces:
Serializable
Compressive Sampling Matching Pursuit (CoSaMP) for sparse signal recovery.
CoSaMP is a greedy recovery algorithm with provably near-optimal
guarantees. Given an m × n measurement matrix A and
observations y = A x, where x is k-sparse,
CoSaMP recovers x in O(log(‖x‖/ε)) iterations, each of
which requires only a matrix–vector product and a least-squares solve on a
small sub-system.
The algorithm maintains a candidate support of size at most 2k,
updates it via a "signal proxy" (the gradient of the data-fit term), prunes
it back to size k, and re-estimates the signal coefficients by
least-squares on the pruned support.
Algorithm sketch (one iteration)
- Proxy:
e = A^T rwherer = y − A x_old. - Identify: merge support of
x_oldwith the2klargest entries ofe; form union support Ω. - Least-squares:
b = arg min ‖y − A_Ω b‖₂. - Prune: retain only the
klargest entries ofb; this gives the new support and estimatex_new. - Residual:
r = y − A x_new.
References
- D. Needell and J. A. Tropp, "CoSaMP: Iterative signal recovery from incomplete and inaccurate samples", Appl. Comput. Harmon. Anal., 26(3):301–321, 2009.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCoSaMP(double[] x, int[] support, int iter) Creates an instance of aCoSaMPrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static CoSaMPRecovers a sparse signal via CoSaMP.static CoSaMPfit(Matrix A, double[] y, CoSaMP.Options options) Recovers a sparse signal via CoSaMP.final inthashCode()Returns a hash code value for this object.intiter()Returns the value of theiterrecord component.int[]support()Returns the value of thesupportrecord component.final StringtoString()Returns a string representation of this record class.double[]x()Returns the value of thexrecord component.
-
Constructor Details
-
CoSaMP
-
-
Method Details
-
fit
-
fit
Recovers a sparse signal via CoSaMP.- Parameters:
A- them × nmeasurement matrix.y- them-dimensional measurement vector.options- solver hyperparameters.- Returns:
- the recovered signal.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
x
-
support
-
iter
-