comparison DL/Majorization Minimization DL/ExactDicoRecovery/mapdl_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
comparison
equal deleted inserted replaced
154:0de08f68256b 155:b14209313ba4
1 % Maximum A Posteriori Estimation for Dictionary Learning
2 % Y = input data (M X L matrix)
3 % Phi = initial dictionary (M X N), e.g. random dictionary or first N data samples
4 % lambda = regularization coefficient (||Phi*X-Y||_F)^2 + lambda*||X||_1
5 % IT + number of iterations
6 % res = dictionary constraint. 'un' = unit colomn norm, 'bn' = bounded colomn norm
7 function [Phiout,X,ert] = mapdl_cn(Y,Phi,lambda,IT,res)
8 maxIT = 1000;
9 [PhiN,PhiM] = size(Phi);
10 RR1 = PhiM;
11 %%%%%%%%%%%%%%
12 % [PhiM,L] = size(ud);
13 [PhiN,L] = size(Y);
14 X = ones(PhiM,L);
15 for it = 1:IT
16 to = .1+svds(Phi,1);
17 [PhiN,PhiM] = size(Phi);
18 %%%%
19 eps = 3*10^-4;
20 map = 1; % Projecting on the selected space (0=no,1=yes)
21 [X,l1err] = mm1(Phi,Y,X,to,lambda,maxIT,eps,map); %% Sparse approximation with Iterative Soft-thresholding
22 ert(it) = l1err;
23 %%%
24 eps = 10^-7;
25 mu = 10^-4;
26 [Phi,X] = dict_update_MAP_cn(Phi,Y,X,mu,maxIT,eps,res);
27 end
28 Phiout = Phi;