Mercurial > hg > smallbox
comparison DL/Majorization Minimization DL/ExactDicoRecovery/dict_update_KSVD_cn.m @ 164:4205744092e6 release_1.9
Merge from branch "ivand_dev"
author | Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk> |
---|---|
date | Wed, 07 Sep 2011 14:17:30 +0100 |
parents | b14209313ba4 |
children |
comparison
equal
deleted
inserted
replaced
151:af5abc34a5e1 | 164:4205744092e6 |
---|---|
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 |