Mercurial > hg > smallbox
comparison DL/Majorization Minimization DL/ExactDicoRecovery/mapfn.m @ 159:23763c5fbda5 danieleb
Merge
author | Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk> |
---|---|
date | Wed, 31 Aug 2011 10:43:32 +0100 |
parents | b14209313ba4 |
children |
comparison
equal
deleted
inserted
replaced
158:855aa3288394 | 159:23763c5fbda5 |
---|---|
1 %% Maximum A Posteriori Dictionary Learning with the constraint on the column norms %%%%% | |
2 function [Phiout,unhatnz] = mapfn(Phi,x,unhat,mu,maxIT,eps,phim,res) | |
3 K = Phi; | |
4 B = zeros(size(Phi,1),size(Phi,2)); | |
5 i = 1; | |
6 while (sum(sum((B-K).^2))>eps)&&(i<=maxIT) | |
7 B = K; | |
8 E = x-K*unhat; | |
9 K = K+mu*(phim*E*unhat'-trace(unhat*E'*K)*K); | |
10 i = i+1; | |
11 end | |
12 %%% depleted atoms cancellation %%% | |
13 [Y,I] = sort(sum(K.^2),'descend'); | |
14 RR = phim; | |
15 Phiout = K(:,I(1:RR)); | |
16 unhatnz = unhat(I(1:RR),:); |