Mercurial > hg > smallbox
annotate DL/Majorization Minimization DL/ExactDicoRecovery/dict_update_MOD_cn.m @ 160:e3035d45d014 danieleb
Added support classes
author | Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk> |
---|---|
date | Wed, 31 Aug 2011 10:53:10 +0100 |
parents | b14209313ba4 |
children |
rev | line source |
---|---|
ivan@155 | 1 function [Phiout,unhatnz] = dict_update_MOD_cn(x,unhat,cvset) |
ivan@155 | 2 %% Method of Optimized Direction (MOD) Dictionary Update followed by the |
ivan@155 | 3 %% constraint on the column norms %% |
ivan@155 | 4 |
ivan@155 | 5 %% |
ivan@155 | 6 eps = .01; |
ivan@155 | 7 K = x*unhat'*inv(unhat*unhat'+eps*eye(size(unhat,1))); |
ivan@155 | 8 if cvset == 1, |
ivan@155 | 9 K = K*diag(min(sum(K.^2).^(-.5),1)); % Projecting on the convex constraint set |
ivan@155 | 10 else |
ivan@155 | 11 K = K*diag(sum(K.^2).^(-.5)); % Projecting on the Unit-Norm constraint set |
ivan@155 | 12 end |
ivan@155 | 13 |
ivan@155 | 14 %% depleted atoms cancellation %%% |
ivan@155 | 15 [Y,I] = sort(sum(K.^2),'descend'); |
ivan@155 | 16 RR = sum(Y>=.01); |
ivan@155 | 17 Phiout = K(:,I(1:RR)); |
ivan@155 | 18 unhatnz = unhat(I(1:RR),:); |
ivan@155 | 19 |
ivan@155 | 20 end |