diff DL/Majorization Minimization DL/ExactDicoRecovery/dict_update_MAP_cn.m @ 164:4205744092e6 release_1.9

Merge from branch "ivand_dev"
author Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk>
date Wed, 07 Sep 2011 14:17:30 +0100
parents b14209313ba4
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DL/Majorization Minimization DL/ExactDicoRecovery/dict_update_MAP_cn.m	Wed Sep 07 14:17:30 2011 +0100
@@ -0,0 +1,27 @@
+function [Phiout,unhatnz] = dict_update_MAP_cn(Phi,x,unhat,mu,maxIT,eps,cvset)
+%% Maximum A Posteriori Dictionary Update with the constraint on the column norms %%%%%
+
+
+
+%%
+
+K = Phi;
+B = zeros(size(Phi,1),size(Phi,2));
+i = 1;
+%%
+while (sum(sum((B-K).^2))>eps)&&(i<=maxIT)
+    B = K;
+    for j = 1:size(K,2),
+        K(:,j) = K(:,j) - mu*(eye(size(K,1))-K(:,j)*K(:,j)')*(K*unhat-x)*unhat(j,:)';           
+    end
+    i = i+1;
+end
+
+%% depleted atoms cancellation %%%
+
+[Y,I] = sort(sum(K.^2),'descend');
+RR = sum(Y>=.01);
+Phiout = K(:,I(1:RR));
+unhatnz = unhat(I(1:RR),:);
+
+end