annotate DL/Majorization Minimization DL/ExactDicoRecovery/dict_update_MAP_cn.m @ 224:fd0b5d36f6ad danieleb

Updated the contents of this branch with the contents of the default branch.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Thu, 12 Apr 2012 13:52:28 +0100
parents b14209313ba4
children
rev   line source
ivan@155 1 function [Phiout,unhatnz] = dict_update_MAP_cn(Phi,x,unhat,mu,maxIT,eps,cvset)
ivan@155 2 %% Maximum A Posteriori Dictionary Update with the constraint on the column norms %%%%%
ivan@155 3
ivan@155 4
ivan@155 5
ivan@155 6 %%
ivan@155 7
ivan@155 8 K = Phi;
ivan@155 9 B = zeros(size(Phi,1),size(Phi,2));
ivan@155 10 i = 1;
ivan@155 11 %%
ivan@155 12 while (sum(sum((B-K).^2))>eps)&&(i<=maxIT)
ivan@155 13 B = K;
ivan@155 14 for j = 1:size(K,2),
ivan@155 15 K(:,j) = K(:,j) - mu*(eye(size(K,1))-K(:,j)*K(:,j)')*(K*unhat-x)*unhat(j,:)';
ivan@155 16 end
ivan@155 17 i = i+1;
ivan@155 18 end
ivan@155 19
ivan@155 20 %% depleted atoms cancellation %%%
ivan@155 21
ivan@155 22 [Y,I] = sort(sum(K.^2),'descend');
ivan@155 23 RR = sum(Y>=.01);
ivan@155 24 Phiout = K(:,I(1:RR));
ivan@155 25 unhatnz = unhat(I(1:RR),:);
ivan@155 26
ivan@155 27 end