diff DL/Majorization Minimization DL/ExactDicoRecovery/dict_update_MOD_cn.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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DL/Majorization Minimization DL/ExactDicoRecovery/dict_update_MOD_cn.m	Mon Aug 22 11:46:35 2011 +0100
@@ -0,0 +1,20 @@
+function [Phiout,unhatnz] = dict_update_MOD_cn(x,unhat,cvset)
+%% Method of Optimized Direction (MOD) Dictionary Update followed by the
+%% constraint on the column norms %%
+
+%%
+eps = .01;
+K = x*unhat'*inv(unhat*unhat'+eps*eye(size(unhat,1)));   
+if cvset == 1,
+    K = K*diag(min(sum(K.^2).^(-.5),1)); % Projecting on the convex constraint set
+else
+    K = K*diag(sum(K.^2).^(-.5)); % Projecting on the Unit-Norm constraint set
+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
\ No newline at end of file