annotate DL/Majorization Minimization DL/ExactDicoRecovery/mapfn.m @ 155:b14209313ba4 ivand_dev

Integration of Majorization Minimisation Dictionary Learning
author Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk>
date Mon, 22 Aug 2011 11:46:35 +0100
parents
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),:);