Mercurial > hg > smallbox
annotate DL/Majorization Minimization DL/ExactDicoRecovery/dict_update_MAP_cn.m @ 160:e3035d45d014 danieleb
Added support classes
author | Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk> |
---|---|
date | Wed, 31 Aug 2011 10:53:10 +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 |