Mercurial > hg > smallbox
comparison DL/Majorization Minimization DL/ExactDicoRecovery/dict_update_MOD_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_MOD_cn(x,unhat,cvset) | |
2 %% Method of Optimized Direction (MOD) Dictionary Update followed by the | |
3 %% constraint on the column norms %% | |
4 | |
5 %% | |
6 eps = .01; | |
7 K = x*unhat'*inv(unhat*unhat'+eps*eye(size(unhat,1))); | |
8 if cvset == 1, | |
9 K = K*diag(min(sum(K.^2).^(-.5),1)); % Projecting on the convex constraint set | |
10 else | |
11 K = K*diag(sum(K.^2).^(-.5)); % Projecting on the Unit-Norm constraint set | |
12 end | |
13 | |
14 %% depleted atoms cancellation %%% | |
15 [Y,I] = sort(sum(K.^2),'descend'); | |
16 RR = sum(Y>=.01); | |
17 Phiout = K(:,I(1:RR)); | |
18 unhatnz = unhat(I(1:RR),:); | |
19 | |
20 end |