comparison DL/Majorization Minimization DL/ExactDicoRecovery/dict_update_KSVD_cn.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 function[Phiout,unhatnz] = dict_update_KSVD_cn(Phi,x,unhat)
2 %% K-SVD Dictionary Learning with the constraint on the column norms %%%%%
3
4 %%
5 unhatn = unhat;
6 rPerm = randperm(size(Phi,2));
7 %% for l = 1:size(Phi,2),
8 for l = rPerm
9 unhatns = unhat;
10 unhatns(l,:) = zeros(1,size(unhat,2));
11 E = x-Phi*unhatns;
12 ER = E(:,(abs(unhat(l,:))>0));
13 [U,S,V] = svd(ER,0);
14 Phi(:,l) = U(:,1)
15 unhatn(l,:) = zeros(1,size(unhat,2));
16 unhatn(l,(abs(unhat(l,:))>0)) = S(1,1)*V(:,1);
17 unhat = unhatn;
18 end
19 %%
20 unhatnz = unhat;
21 Phiout = Phi;
22 end