bpdq_d_r_iter

PURPOSE ^

bpdq_d_r_iter : Douglas-Rachford Iteration

SYNOPSIS ^

function [xstar,relerr_save]=bpdq_d_r_iter(proxf1,proxf2,gamma,lambda,x0,varargin)

DESCRIPTION ^

 bpdq_d_r_iter : Douglas-Rachford Iteration

 [xstar,relerr_save]=bpdq_d_r_iter(proxf1,proxf2,gamma,lambda,x0,varargin)

 Implements Douglas-Rachford Splitting to solve
 xstar = argmin_x [ f1(x) + f2(x) ]

 Inputs:
 proxf1, proxf2 - function handles computing prox(gamma*f1), prox(gamma*f2)
 i.e., proxf1(y,gamma) solves argmin_x [ (1/2) |y-x|^2 + gamma * f(x) ]
 gamma, lambda -  Douglas-Rachford algorithm parameters
 x0 - starting point

 Selectable control parameters:
 dr_maxiter - maximum # of iterations
 dr_relerr_thresh - relative error threshold to terminate iteration
 dr_verbosity - 0 to supress output, 1 to output relative error at each 
 iteration

 Outputs :
 xstar - returned solution
 relerr_save - record of relative error of iterates; 
 relerr_save(n) = ||x_n-x_(n-1)||/||x_n||

 This file is part of BPDQ Toolbox (Basis Pursuit DeQuantizer)
 Copyright (C) 2009, the BPDQ Team (see the file AUTHORS distributed with
 this library) (See the notice at the end of the file.)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % bpdq_d_r_iter : Douglas-Rachford Iteration
0002 %
0003 % [xstar,relerr_save]=bpdq_d_r_iter(proxf1,proxf2,gamma,lambda,x0,varargin)
0004 %
0005 % Implements Douglas-Rachford Splitting to solve
0006 % xstar = argmin_x [ f1(x) + f2(x) ]
0007 %
0008 % Inputs:
0009 % proxf1, proxf2 - function handles computing prox(gamma*f1), prox(gamma*f2)
0010 % i.e., proxf1(y,gamma) solves argmin_x [ (1/2) |y-x|^2 + gamma * f(x) ]
0011 % gamma, lambda -  Douglas-Rachford algorithm parameters
0012 % x0 - starting point
0013 %
0014 % Selectable control parameters:
0015 % dr_maxiter - maximum # of iterations
0016 % dr_relerr_thresh - relative error threshold to terminate iteration
0017 % dr_verbosity - 0 to supress output, 1 to output relative error at each
0018 % iteration
0019 %
0020 % Outputs :
0021 % xstar - returned solution
0022 % relerr_save - record of relative error of iterates;
0023 % relerr_save(n) = ||x_n-x_(n-1)||/||x_n||
0024 %
0025 % This file is part of BPDQ Toolbox (Basis Pursuit DeQuantizer)
0026 % Copyright (C) 2009, the BPDQ Team (see the file AUTHORS distributed with
0027 % this library) (See the notice at the end of the file.)
0028 
0029 function [xstar,relerr_save]=bpdq_d_r_iter(proxf1,proxf2,gamma,lambda,...
0030                                            x0,varargin)
0031   control_params={'dr_maxiter',500,...
0032                   'dr_relerr_thresh',1e-6,...
0033                   'dr_verbosity',0};
0034   argselectAssign(control_params);
0035   argselectCheck(control_params,varargin);
0036   argselectAssign(varargin);
0037 
0038   xp_old=zeros(size(x0));
0039   xp_new=zeros(size(x0));
0040   x_new=zeros(size(x0));
0041   x_old=x0;
0042   for n=1:dr_maxiter
0043     xp_old=xp_new; 
0044     if (n>1)
0045       x_old=x_new;
0046     end
0047     
0048     xp_new=proxf1(x_old,gamma);
0049     x_new = x_old + lambda*(proxf2(2*xp_new-x_old,gamma)-xp_new);
0050     relerr = norm(xp_old-xp_new)/norm(xp_new);
0051     relerr_save(n)=relerr;
0052     if (dr_verbosity>=1)
0053       fprintf('DR iter %g, relerr = %g\n',n,relerr);
0054     end
0055     if (relerr<dr_relerr_thresh) && (n>3)
0056       break;
0057     end      
0058     %keyboard
0059   end
0060   xstar=proxf1(x_new,gamma);
0061   
0062 % The BPDQ Toolbox is free software: you can redistribute it and/or modify
0063 % it under the terms of the GNU General Public License as published by
0064 % the Free Software Foundation, either version 3 of the License, or
0065 % (at your option) any later version.
0066 %
0067 % The BPDQ Toolbox is distributed in the hope that it will be useful,
0068 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0069 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0070 % GNU General Public License for more details.
0071 %
0072 % You should have received a copy of the GNU General Public License
0073 % along with The BPDQ Toolbox.  If not, see <http://www.gnu.org/licenses/>.

Generated on Mon 06-Jul-2009 14:16:10 by m2html © 2003