Mercurial > hg > smallbox
annotate DL/Majorization Minimization DL/ExactDicoRecovery/mapfn.m @ 184:8fc38e8df8c6 danieleb
Minor edits
author | Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk> |
---|---|
date | Fri, 27 Jan 2012 13:18:50 +0000 |
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),:); |