comparison DL/Majorization Minimization DL/wrapper_mm_solver.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 f42aa8bcb82f
comparison
equal deleted inserted replaced
154:0de08f68256b 155:b14209313ba4
1 function [X , cost] = wrapper_mm_solver(b, A, param)
2 %% SMALL wrapper for Majorization Maximization toolbos solver
3 %
4 % Function gets as input
5 % b - measurement vector
6 % A - dictionary
7 % param - structure containing additional parameters
8 % Output:
9 % x - sparse solution
10 % cost - Objective cost
11
12 % Centre for Digital Music, Queen Mary, University of London.
13 % This file copyright 2011 Ivan Damnjanovic.
14 %
15 % This program is free software; you can redistribute it and/or
16 % modify it under the terms of the GNU General Public License as
17 % published by the Free Software Foundation; either version 2 of the
18 % License, or (at your option) any later version. See the file
19 % COPYING included with this distribution for more information.
20 %
21 %%
22
23 % Initial guess for the coefficients
24
25 if (isfield(param, 'initcoeff'))
26 initX = param.initcoeff;
27 else
28 initX = zeros(size(A,2),size(b,2));
29 end
30
31 % to - 1/(step size) . It is larger than spectral norm of dictionary A
32
33 if isfield(param, 'to')
34 to = param.to;
35 else
36 to = .1+svds(A,1);
37 end
38
39 % lambda - Lagrangian multiplier. (regulates shrinkage)
40
41 if isfield(param, 'lambda')
42 lambda = param.lambda;
43 else
44 lambda = 2*.2;
45 end
46
47 % Inner-loop maximum iteration number.
48
49 if isfield(param, 'iternum')
50 maxIT = param.iternum;
51 else
52 maxIT = 1000;
53 end
54
55 % Stopping criterion for iterative softthresholding
56
57 if isfield(param, 'epsilon')
58 epsilon = param.epsilon;
59 else
60 epsilon = 1e-7;
61 end
62
63 % Debiasing. 0 = No, 1 = Yes
64
65 if isfield(param, 'map')
66 map = param.map;
67 else
68 map = 1;
69 end
70
71
72 [X, cost] = mm1(A,b,initX,to,lambda,maxIT,epsilon,map);
73 cost
74 end