comparison DL/Majorization Minimization DL/ExactDicoRecovery/dict_update_KSVD_cn.m @ 159:23763c5fbda5 danieleb

Merge
author Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk>
date Wed, 31 Aug 2011 10:43:32 +0100
parents b14209313ba4
children
comparison
equal deleted inserted replaced
158:855aa3288394 159:23763c5fbda5
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