annotate DL/Majorization Minimization DL/ExactDicoRecovery/dict_update_MOD_cn.m @ 247:ecce33192fcc tip

Added tag ver_2.1 for changeset cef4500b936f
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Wed, 31 Oct 2012 12:24:44 +0000
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