view DL/Majorization Minimization DL/wrapper_mm_solver.m @ 211:0c7c20f3246c luisf_dev

Added comments to ~/DL/Majorization Minimization DL/wrapper_mm_DL.m and ~/DL/Majorization Minimization DL/wrapper_mm_solver.m files.
author Aris Gretsistas <aris.gretsistas@elec.qmul.ac.uk>
date Wed, 21 Mar 2012 17:48:39 +0000
parents f42aa8bcb82f
children 4337e28183f1
line wrap: on
line source
function [X , cost] = wrapper_mm_solver(b, A, param)
%% SMALL wrapper for Majorization Minimization toolbox solver
%
%   Function gets as input
%       b - measurement vector 
%       A - dictionary 
%       param - structure containing additional parameters
%   Output:
%       x - sparse solution
%       cost - Objective cost

%   Centre for Digital Music, Queen Mary, University of London.
%   This file copyright 2011 Ivan Damnjanovic.
%
%   This program is free software; you can redistribute it and/or
%   modify it under the terms of the GNU General Public License as
%   published by the Free Software Foundation; either version 2 of the
%   License, or (at your option) any later version.  See the file
%   COPYING included with this distribution for more information.
%   
%%

% Initial guess for the coefficients

if (isfield(param, 'initcoeff'))
   initX = param.initcoeff;
else
   initX = zeros(size(A,2),size(b,2));
end

% to - 1/(step size) . It is larger than spectral norm of dictionary A

if isfield(param, 'to')
   to = param.to;
else
   to = .1+(svds(A,1))^2;
end

% lambda - Lagrangian multiplier. (regulates shrinkage)

if isfield(param, 'lambda')
    lambda = param.lambda;
else
    lambda = 2*.2; 
end

% Inner-loop maximum iteration number.

if isfield(param, 'iternum')
    maxIT = param.iternum;
else
    maxIT = 1000; 
end

% Stopping criterion for iterative softthresholding

if isfield(param, 'epsilon')
    epsilon = param.epsilon;
else
    epsilon = 1e-7; 
end

% Debiasing. 0 = No, 1 = Yes

if isfield(param, 'map')
    map = param.map;
else
    map = 0; 
end


[X, cost] = mm1(A,b,initX,to,lambda,maxIT,epsilon,map); 
cost
end