


bpdq_prox_f_comp_A : compute prox of g(x) = f(A(x)) function [r,relerr_save] = bpdq_prox_f_comp_A(x,proxcf,opA,opAt,c,varargin) Prox is computed by iteration (lemma 4 of Jacques et al) Inputs: x - input independent variable proxcf - function handle for computing prox_(c*f) opA, opAt - function handles computing multiplication by A and A transpose c - constant, should be greater than half of operator norm of A Selectable control parameters : fca_maxiter - maximum # of iterations fca_relerr_thresh - relative error threshold to terminate iteration fca_verbosity - 0 to supress output, 1 to output # of iterations until threshold reached, 2 to output relative error at each iteration. Outputs : r - prox of g(x)=f(A(x)) relerr_save - record of relative error of iterates. 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.)


0001 % bpdq_prox_f_comp_A : compute prox of g(x) = f(A(x)) 0002 % 0003 % function [r,relerr_save] = bpdq_prox_f_comp_A(x,proxcf,opA,opAt,c,varargin) 0004 % 0005 % Prox is computed by iteration (lemma 4 of Jacques et al) 0006 % 0007 % Inputs: 0008 % x - input independent variable 0009 % proxcf - function handle for computing prox_(c*f) 0010 % opA, opAt - function handles computing multiplication by A and A transpose 0011 % c - constant, should be greater than half of operator norm of A 0012 % 0013 % Selectable control parameters : 0014 % fca_maxiter - maximum # of iterations 0015 % fca_relerr_thresh - relative error threshold to terminate iteration 0016 % fca_verbosity - 0 to supress output, 1 to output # of iterations until 0017 % threshold reached, 2 to output relative error at each iteration. 0018 % 0019 % Outputs : 0020 % r - prox of g(x)=f(A(x)) 0021 % relerr_save - record of relative error of iterates. 0022 % 0023 % This file is part of BPDQ Toolbox (Basis Pursuit DeQuantizer) 0024 % Copyright (C) 2009, the BPDQ Team (see the file AUTHORS distributed with 0025 % this library) (See the notice at the end of the file.) 0026 0027 function [r,relerr_save] = bpdq_prox_f_comp_A(x,proxcf,opA,opAt,c,varargin) 0028 control_params={'fca_maxiter',500,... 0029 'fca_relerr_thresh',1e-6,... 0030 'fca_verbosity',0}; 0031 argselectAssign(control_params); 0032 argselectCheck(control_params,varargin); 0033 argselectAssign(varargin); 0034 0035 u_old = opA(x); 0036 p_old=x; 0037 for n=1:fca_maxiter 0038 p_new = x-opAt(u_old); 0039 tmp1=c*u_old + opA(p_new); 0040 u_new = (1/c)*(tmp1-proxcf(tmp1,c)); 0041 0042 relerr=norm(p_new-p_old)/norm(p_new); 0043 relerr_save(n)=relerr; 0044 0045 u_old=u_new; 0046 p_old=p_new; 0047 if (fca_verbosity>=2) 0048 fprintf('fca iteration n %g, relerr %g\n',n,relerr); 0049 end 0050 if (relerr<fca_relerr_thresh) 0051 if (fca_verbosity>=1) 0052 fprintf('fca relerr %g reached at %g iterations\n',... 0053 relerr,n); 0054 end 0055 break; 0056 end 0057 end 0058 r=x-opAt(u_new); 0059 0060 % The BPDQ Toolbox is free software: you can redistribute it and/or modify 0061 % it under the terms of the GNU General Public License as published by 0062 % the Free Software Foundation, either version 3 of the License, or 0063 % (at your option) any later version. 0064 % 0065 % The BPDQ Toolbox is distributed in the hope that it will be useful, 0066 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0067 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0068 % GNU General Public License for more details. 0069 % 0070 % You should have received a copy of the GNU General Public License 0071 % along with The BPDQ Toolbox. If not, see <http://www.gnu.org/licenses/>.