comparison solvers/SMALL_MP.m @ 3:01cad25206d6

(none)
author idamnjanovic
date Fri, 05 Mar 2010 12:31:22 +0000
parents 257c289bf11d
children 524cc3fff5ac
comparison
equal deleted inserted replaced
2:257c289bf11d 3:01cad25206d6
1 function [A]=SMALL_MP(Dict,X, m, maxNumCoef, errorGoal1, varargin) 1 function [A]=SMALL_MP(Dict,X, m, maxNumCoef, errorGoal, varargin)
2 %% 2 %%
3 %============================================= 3 %=============================================
4 % Sparse coding of a group of signals based on a given 4 % Sparse coding of a group of signals based on a given
5 % dictionary and specified number of atoms to use. 5 % dictionary and specified number of atoms to use.
6 % input arguments: Dict - the dictionary 6 % input arguments: Dict - the dictionary
55 residual=x; 55 residual=x;
56 indx = []; 56 indx = [];
57 j=0; 57 j=0;
58 58
59 currResNorm = norm(residual); 59 currResNorm = norm(residual);
60 errorGoal=errorGoal1*currResNorm; 60 errGoal=errorGoal*currResNorm;
61 61
62 a = zeros(m,1); 62 a = zeros(m,1);
63 63
64 64
65 while currResNorm>errorGoal & j < maxNumCoef, 65 while currResNorm>errGoal && j < maxNumCoef,
66 66
67 j = j+1; 67 j = j+1;
68 dir=Dt(residual); 68 dir=Dt(residual);
69 69
70 [tmp__, pos]=max(abs(dir)); 70 [tmp__, pos]=max(abs(dir));