annotate DL/Majorization Minimization DL/ExactDicoRecovery/ExactRec_Demo.m @ 247:ecce33192fcc tip

Added tag ver_2.1 for changeset cef4500b936f
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Wed, 31 Oct 2012 12:24:44 +0000
parents b14209313ba4
children
rev   line source
ivan@155 1 clear
ivan@155 2 IT = 1000; % Number of iterations
ivan@155 3 R = 3:7; % Sparsity of the signals
ivan@155 4 SN = 5; % Number of trials
ivan@155 5 M = 20; % Signal space dimension
ivan@155 6 N = 40; % Ambient space dimension
ivan@155 7 L = 32*N; % Number of training signals
ivan@155 8
ivan@155 9 ParamGen(M,N,L,R,SN) % Generating generic problems
ivan@155 10
ivan@155 11 %%%% Dictionary recovery algorithms
ivan@155 12 for sn = 1:SN
ivan@155 13 for r = R
ivan@155 14 mmdlcn_exactRec_demo(IT,r,sn,'un')
ivan@155 15 mapcn_exactRec_demo(IT,r,sn,'bn')
ivan@155 16 ksvd_exactRec_demo(IT,r,sn)
ivan@155 17 modcn_exactRec_demo(IT,r,sn)
ivan@155 18 end
ivan@155 19 end
ivan@155 20 %%%%%%%
ivan@155 21 Tre = .99;
ivan@155 22 for k = R
ivan@155 23 for i=1:SN
ivan@155 24 load(['RDLl1',num2str(M),'t',num2str(IT),'ikiun',num2str(k),'v1d',num2str(i),'.mat'])
ivan@155 25 nrRDLu(i,k-R(1)+1) = sum(max(abs((Phid'*Phi)))>=Tre);
ivan@155 26 %%%%%%
ivan@155 27 load(['MAPl1',num2str(M),'t',num2str(IT),'ikiun',num2str(k),'v1d',num2str(i),'.mat'])
ivan@155 28 nrMAP(i,k-R(1)+1) = sum(max(abs((Phid'*Phi)))>=Tre);
ivan@155 29 %%%%%%
ivan@155 30 load(['KSVDl1',num2str(M),'t',num2str(IT),'ikiun',num2str(k),'v1d',num2str(i),'.mat'])
ivan@155 31 nrKSVD(i,k-R(1)+1) = sum(max(abs((Phid'*Phi)))>=Tre);
ivan@155 32 %%%%%%
ivan@155 33 load(['MODl1',num2str(M),'t',num2str(IT),'ikiun',num2str(k),'v1d',num2str(i),'.mat'])
ivan@155 34 nrMOD(i,k-R(1)+1) = sum(max(abs((Phid'*Phi)))>=Tre);
ivan@155 35 end
ivan@155 36 end
ivan@155 37 clf
ivan@155 38 errorbar(R+.01,10*mean(nrRDLu,1)/4,std(nrRDLu,0,1),'k-.')
ivan@155 39 hold on
ivan@155 40 errorbar(R-.01,10*mean(nrKSVD,1)/4,std(nrKSVD,0,1),'r*-')
ivan@155 41 errorbar(R+.01,10*mean(nrMOD,1)/4,std(nrMOD,0,1),'b-v')
ivan@155 42 errorbar(R-.01,10*mean(nrMAP,1)/4,std(nrMAP,0,1),'b-^')
ivan@155 43 axis([2.5 7.5 15 105]);
ivan@155 44 title('Constrained column-norm dictionaries')
ivan@155 45 xlabel('Sparsity (# of non-zero elements in each coefficient vector)')
ivan@155 46 ylabel(['Average percents of exact recovery',sprintf('\n'),'after ',num2str(IT),' iterations'])
ivan@155 47 grid on
ivan@155 48 legend('MM Unit norm','K-SVD','MOD','MAPbased-DL');
ivan@155 49 axis([2.8 7.2 -5 105])