view DL/Majorization Minimization DL/wrapper_mm_solver.m @ 186:9c418bea7f6a bug_386

Addresses Bug #386: removed the 4th output variable (versn) in all calls of function fileparts.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Thu, 09 Feb 2012 17:25:14 +0000
parents f42aa8bcb82f
children 0c7c20f3246c
line wrap: on
line source
function [X , cost] = wrapper_mm_solver(b, A, param)
%% SMALL wrapper for Majorization Maximization toolbos 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