annotate DL/Majorization Minimization DL/ExactDicoRecovery/mapfn.m @ 239:71128ec3e532 ver_2.0_beta

added documentation file/folder
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Wed, 25 Apr 2012 13:06:28 +0100
parents b14209313ba4
children
rev   line source
ivan@155 1 %% Maximum A Posteriori Dictionary Learning with the constraint on the column norms %%%%%
ivan@155 2 function [Phiout,unhatnz] = mapfn(Phi,x,unhat,mu,maxIT,eps,phim,res)
ivan@155 3 K = Phi;
ivan@155 4 B = zeros(size(Phi,1),size(Phi,2));
ivan@155 5 i = 1;
ivan@155 6 while (sum(sum((B-K).^2))>eps)&&(i<=maxIT)
ivan@155 7 B = K;
ivan@155 8 E = x-K*unhat;
ivan@155 9 K = K+mu*(phim*E*unhat'-trace(unhat*E'*K)*K);
ivan@155 10 i = i+1;
ivan@155 11 end
ivan@155 12 %%% depleted atoms cancellation %%%
ivan@155 13 [Y,I] = sort(sum(K.^2),'descend');
ivan@155 14 RR = phim;
ivan@155 15 Phiout = K(:,I(1:RR));
ivan@155 16 unhatnz = unhat(I(1:RR),:);