|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mpv2.MatchingPursuit
public class MatchingPursuit
This class includes several closely related algorithmes for Matching Pursuit (MP).
MP finds a sparse, only few non-zero elements, vector w such that the product
of this vector and a dictionary (matrix) is close to a given vector x.
Assume w is K-by-1 and sparse, x is N-by-1, and D is N-by-K, then the MP algoritms
are greedy algoritms that (try to) minimize the representation error, err = ||x - Dw||,
given a sparsness limit (for w) or error limit (err).
The MP methods are:
The dictionary D
to use is given as an argument
when an object of this class is constructed. The Dictionary should be
an object of a descendant of the AllMatrices abstract class.
The innerproducts, a symmetric matrix, D'*D, may be given as a
second argument.
Note that the values of the matrices are not copied into this object,
so any changes done after construction will affect vector seclection.
The few used methods belonging to the dictionary,
which by the way should be effectivly implemented, are:
Constructor Summary | |
---|---|
MatchingPursuit(AllMatrices D)
Instantiate an object of this class, and thus making the vector selection algorithms available to the calling program. |
|
MatchingPursuit(AllMatrices D,
SymmetricMatrix M)
Instantiate an object of this class, and thus making the vector selection algorithms available to the calling program. |
Method Summary | |
---|---|
boolean |
checkNormalized()
Check if dictionary is normalized, and update the normalized indicator. |
void |
clearNormalized()
Clear dictionary normalized indicator, set it to false, without checking. |
boolean |
getNormalized()
Get dictionary normalized indicator without checking dictionary. |
void |
setNormalized()
Set dictionary normalized indicator to true without checking. |
double[] |
vsBMP(double[] x,
int S)
Use the Basic Matching Pursuit algoritm to find the sparse weight vector w such that ||x-D·w|| is minimized (but not minimal)
subject to sparseness in w . |
double[] |
vsOMP(double[] x,
double errLim)
Uses the Orthogonal Matching Pursuit algoritm to find the sparse weight vector w such that ||x-D·w|| is minimized (but not minimal)
subject to sparseness in w . |
double[] |
vsOMP(double[] x,
int S)
Uses the Orthogonal Matching Pursuit algoritm to find the sparse weight vector w such that ||x-D·w|| is minimized (but not minimal)
subject to sparseness in w . |
double[] |
vsOMP(double[] x,
int S,
double errLim)
Uses the Orthogonal Matching Pursuit algoritm to find the sparse weight vector w such that ||x-D·w|| is minimized (but not minimal)
subject to sparseness in w . |
double[] |
vsORMP(double[] x,
double errLim)
Uses the Order Recursive Matching Pursuit algoritm to find the sparse weight vector w such that ||x-D·w|| is minimized (but not minimal)
subject to sparseness in w . |
double[] |
vsORMP(double[] x,
int S)
Uses the Order Recursive Matching Pursuit algoritm to find the sparse weight vector w such that ||x-D·w|| is minimized (but not minimal)
subject to sparseness in w . |
double[] |
vsORMP(double[] x,
int S,
double errLim)
Uses the Order Recursive Matching Pursuit algoritm to find the sparse weight vector w such that ||x-D·w|| is minimized (but not minimal)
subject to sparseness in w . |
double[] |
vsPS(double[] x,
int S,
double errLim,
int nComb)
Do Vector Selection by Partial Search. |
double[] |
vsSelectBest(double[] x)
Finds the dictionary vector that best match the given signal. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MatchingPursuit(AllMatrices D)
D
- the dictionary, i.e. a matrix (object of descendant of AllMatrices)public MatchingPursuit(AllMatrices D, SymmetricMatrix M)
D
- the dictionary, i.e. a matrix (object of descendant of AllMatrices)M
- matrix of innerproducts (D'*D)Method Detail |
---|
public boolean checkNormalized()
public boolean getNormalized()
public void setNormalized()
public void clearNormalized()
public double[] vsSelectBest(double[] x)
w
will have one non-zero entry
and it is selected such that the 2-norm of the residual is minimized,
i.e. ||x-D·w||
is minimum. D
is
N×K
, x
is N×1
,
and w
is K×1
.
x
- the signal to be approximated by the sparse representation. It is unchanged.
public double[] vsBMP(double[] x, int S)
w
such that ||x-D·w||
is minimized (but not minimal)
subject to sparseness in w
.
The dimensions are: D
is
N×K
, x
is N×1
,
and w
is K×1
.
x
- the signal to be approximated by the sparse representation. It is unchanged.S
- the number of allowed non-zero weights in w
.
public double[] vsOMP(double[] x, int S)
w
such that ||x-D·w||
is minimized (but not minimal)
subject to sparseness in w
.
The dimensions are: D
is
N×K
, x
is N×1
,
and w
is K×1
.
x
- the signal to be approximated by the sparse representation. It is unchanged.S
- the number of allowed non-zero weights in w.
Note that when this function is called from Matlab we must have int32(S) as argument.
public double[] vsOMP(double[] x, double errLim)
w
such that ||x-D·w||
is minimized (but not minimal)
subject to sparseness in w
.
The dimensions are: D
is
N×K
, x
is N×1
,
and w
is K×1
.
x
- the signal to be approximated by the sparse representation. It is unchanged.errLim
- function returns when this error limit is reached,
i.e. ||r|| < errLim·||x||
,
or when maximum number of vectors are selected.
public double[] vsOMP(double[] x, int S, double errLim)
w
such that ||x-D·w||
is minimized (but not minimal)
subject to sparseness in w
.
The dimensions are: D
is
N×K
, x
is N×1
,
and w
is K×1
.
x
- the signal to be approximated by the sparse representation. It is unchanged.S
- the number of allowed non-zero weights in werrLim
- function returns when this error limit is reached,
i.e. ||r|| < errLim·||x||
,
or when maximum number of vectors are selected.
public double[] vsORMP(double[] x, int S)
w
such that ||x-D·w||
is minimized (but not minimal)
subject to sparseness in w
.
The dimensions are: D
is
N×K
, x
is N×1
,
and w
is K×1
.
x
- the signal to be approximated by the sparse representation. It is unchanged.S
- the number of allowed non-zero weights in w.
Note that when this function is called from Matlab we must have int32(S) as argument.
public double[] vsORMP(double[] x, double errLim)
w
such that ||x-D·w||
is minimized (but not minimal)
subject to sparseness in w
.
The dimensions are: D
is
N×K
, x
is N×1
,
and w
is K×1
.
x
- the signal to be approximated by the sparse representation. It is unchanged.errLim
- function returns when this error limit is reached,
i.e. ||r|| < errLim·||x||
,
or when maximum number of vectors are selected.
public double[] vsORMP(double[] x, int S, double errLim)
w
such that ||x-D·w||
is minimized (but not minimal)
subject to sparseness in w
.
The dimensions are: D
is
N×K
, x
is N×1
,
and w
is K×1
.
x
- the signal to be approximated by the sparse representation. It is unchanged.S
- the number of allowed non-zero weights in werrLim
- function returns when this error limit is reached,
i.e. ||r|| < errLim·||x||
,
or when maximum number of vectors are selected.
public double[] vsPS(double[] x, int S, double errLim, int nComb)
x
- the signal to be approximated by the sparse representation. It is unchanged.S
- allowed number of non-zeros weights in w, or frame vectors used.errLim
- function returns when this error limit is reached,
i.e. ||r|| < errLim·||x||
,
or when maximum number of vectors are selected.nComb
- number of combinations to do
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |