Mercurial > hg > smallbox
comparison DL/Majorization Minimization DL/ExactDicoRecovery/mmdl_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 % Majorization Minimization 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] = mmdl_cn(Y,Phi,lambda,IT,res) | |
8 maxIT = 1000; | |
9 [PhiN,PhiM] = size(Phi); | |
10 RR1 = PhiM; | |
11 %%%%%%%%%%%%%% | |
12 [PhiN,L] = size(Y); | |
13 X = ones(PhiM,L); | |
14 for it = 1:IT | |
15 to = .1+svds(Phi,1); | |
16 [PhiN,PhiM] = size(Phi); | |
17 %%%% | |
18 eps = 3*10^-4; | |
19 map = 1; % Projecting on the selected space (0=no,1=yes) | |
20 [X,l1err] = mm1(Phi,Y,X,to,lambda,maxIT,eps,map); %% Sparse approximation with Iterative Soft-thresholding | |
21 ert(it) = l1err; | |
22 %%% | |
23 eps = 10^-7; | |
24 [Phi,X] = dict_update_REG_cn(Phi,Y,X,maxIT,eps,res); | |
25 end | |
26 Phiout = Phi; |