Mercurial > hg > smallbox
annotate DL/Majorization Minimization DL/ExactDicoRecovery/dict_update_KSVD_cn.m @ 184:8fc38e8df8c6 danieleb
Minor edits
author | Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk> |
---|---|
date | Fri, 27 Jan 2012 13:18:50 +0000 |
parents | b14209313ba4 |
children |
rev | line source |
---|---|
ivan@155 | 1 function[Phiout,unhatnz] = dict_update_KSVD_cn(Phi,x,unhat) |
ivan@155 | 2 %% K-SVD Dictionary Learning with the constraint on the column norms %%%%% |
ivan@155 | 3 |
ivan@155 | 4 %% |
ivan@155 | 5 unhatn = unhat; |
ivan@155 | 6 rPerm = randperm(size(Phi,2)); |
ivan@155 | 7 %% for l = 1:size(Phi,2), |
ivan@155 | 8 for l = rPerm |
ivan@155 | 9 unhatns = unhat; |
ivan@155 | 10 unhatns(l,:) = zeros(1,size(unhat,2)); |
ivan@155 | 11 E = x-Phi*unhatns; |
ivan@155 | 12 ER = E(:,(abs(unhat(l,:))>0)); |
ivan@155 | 13 [U,S,V] = svd(ER,0); |
ivan@155 | 14 Phi(:,l) = U(:,1) |
ivan@155 | 15 unhatn(l,:) = zeros(1,size(unhat,2)); |
ivan@155 | 16 unhatn(l,(abs(unhat(l,:))>0)) = S(1,1)*V(:,1); |
ivan@155 | 17 unhat = unhatn; |
ivan@155 | 18 end |
ivan@155 | 19 %% |
ivan@155 | 20 unhatnz = unhat; |
ivan@155 | 21 Phiout = Phi; |
ivan@155 | 22 end |