Mercurial > hg > smallbox
comparison DL/Majorization Minimization DL/ExactDicoRecovery/mod_exactRec.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 %%% MOD (||ki||<=1) %%%% | |
2 function mod_exactRec(it,k,sn) | |
3 tic | |
4 IT = str2num(it); | |
5 K = str2num(k); | |
6 SN = str2num(sn); | |
7 if SN<10, | |
8 samnum = ['0',num2str(SN)]; | |
9 else | |
10 samnum = num2str(SN); | |
11 end | |
12 load(['Param',num2str(K),'kS',samnum,'.mat']) | |
13 method = ['bn';'un']; | |
14 res = 2; % 1 for bounded-norm, 2 for unit-norm | |
15 lambda = 2*.2; % 2 * Smallest coefficients (Soft Thresholding) | |
16 % lambda = 2*.2^2; % 2 * Smallest coefficients (Hard Thresholding) | |
17 %%%%%%%%%%%%%% | |
18 Phi = Phio; | |
19 [PhiN,PhiM] = size(Phi); | |
20 RR1 = PhiM; | |
21 %%%%%%%%%%%%%% | |
22 [PhiM,L] = size(ud); | |
23 unhat = ones(PhiM,L); | |
24 for it = 1:IT | |
25 it | |
26 to = .1+svds(Phi,1); | |
27 [PhiN,PhiM] = size(Phi); | |
28 %%%% | |
29 % eps = 10^-7; | |
30 eps = 3*10^-4; | |
31 maxIT = 1000; | |
32 map = 0; | |
33 [unhat,l1err] = mm1(Phi,x,unhat,to,lambda,maxIT,eps,map); %% Sparse approximation with Iterative Soft-thresholding | |
34 ert(it) = l1err; | |
35 %%% | |
36 [Phi,unhat] = modcn(x,unhat,res); | |
37 end | |
38 save(['MODl120t',num2str(IT),'iki',method(res,:),num2str(K),'v2d',num2str(SN),'.mat'],'Phi','Phid','x','ud','unhat','ert') | |
39 toc |