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