Description of sopt_mltb_solve_L2DN
Description: sopt_mltb_solve_L2DN - Solve L2DN problem.

Home > matlab > sopt_mltb_solve_L2DN.m

# sopt_mltb_solve_L2DN

## PURPOSE

sopt_mltb_solve_L2DN - Solve L2DN problem.

## SYNOPSIS

function sol = sopt_mltb_solve_L2DN(y, epsilon, A, At, param)

## DESCRIPTION

     sopt_mltb_solve_L2DN - Solve L2DN problem.

     Solve the L2 denoising problem

       min ||x||_2   s.t.  ||y-A x||_2 < epsilon

     where y contains the measurements, A is the forward measurement operator
     and At the associated adjoint operator. The structure param should
     contain the following fields:

       General parameters:

       - verbose: Verbosity level (0 = no log, 1 = summary at convergence,
           2 = print main steps; default = 1).

       - max_iter: Maximum number of iterations (default = 200).

       - rel_obj: Minimum relative change of the objective value
           (default = 1e-4).  The algorithm stops if
               | ||x(t)||_2 - ||x(t-1)||_2 | / ||x(t)||_2 < rel_obj,
           where x(t) is the estimate of the solution at iteration t.

       - gamma: Convergence speed (weighting of L1 norm when solving for
           L1 proximal operator) (default = 1e-1).

       - param.weights: weightsfor a weighted L2-norm defined
           by norm(weights_i.*x_i,2) (default = 1).

       - initsol: Initial solution for a warmstart.

       Projection onto the L2-ball:

       - param.tight_B2: 1 if A is a tight frame or 0 otherwise (default = 1).

       - nu_B2: Bound on the norm of the operator A, i.e.
           ||A x||^2 <= nu * ||x||^2 (default = 1).

       - tol_B2: Tolerance for the projection onto the L2 ball. The algorithms
           stops if
             epsilon/(1-tol) <= ||y - A z||_2 <= epsilon/(1+tol)
           (default = 1e-3).

       - max_iter_B2: Maximum number of iterations for the projection onto the
           L2 ball (default = 200).

       - pos_B2: Positivity flag (1 to impose positivity, 0 otherwise;
           default = 0).

       - real_B2: Reality flag (1 to impose reality, 0 otherwise;
           default = 0).

     References:
     [1] P. L. Combettes and J-C. Pesquet, "A Douglas-Rachford Splitting
     Approach to Nonsmooth Convex Variational Signal Recovery", IEEE Journal
     of Selected Topics in Signal Processing, vol. 1, no. 4, pp. 564-574, 2007.

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

## SOURCE CODE

    0001 function sol = sopt_mltb_solve_L2DN(y, epsilon, A, At, param)
    0002 % sopt_mltb_solve_L2DN - Solve L2DN problem.
    0003 %
    0004 % Solve the L2 denoising problem
    0005 %
    0006 %   min ||x||_2   s.t.  ||y-A x||_2 < epsilon
    0007 %
    0008 % where y contains the measurements, A is the forward measurement operator
    0009 % and At the associated adjoint operator. The structure param should
    0010 % contain the following fields:
    0011 %
    0012 %   General parameters:
    0013 %
    0014 %   - verbose: Verbosity level (0 = no log, 1 = summary at convergence,
    0015 %       2 = print main steps; default = 1).
    0016 %
    0017 %   - max_iter: Maximum number of iterations (default = 200).
    0018 %
    0019 %   - rel_obj: Minimum relative change of the objective value
    0020 %       (default = 1e-4).  The algorithm stops if
    0021 %           | ||x(t)||_2 - ||x(t-1)||_2 | / ||x(t)||_2 < rel_obj,
    0022 %       where x(t) is the estimate of the solution at iteration t.
    0023 %
    0024 %   - gamma: Convergence speed (weighting of L1 norm when solving for
    0025 %       L1 proximal operator) (default = 1e-1).
    0026 %
    0027 %   - param.weights: weightsfor a weighted L2-norm defined
    0028 %       by norm(weights_i.*x_i,2) (default = 1).
    0029 %
    0030 %   - initsol: Initial solution for a warmstart.
    0031 %
    0032 %   Projection onto the L2-ball:
    0033 %
    0034 %   - param.tight_B2: 1 if A is a tight frame or 0 otherwise (default = 1).
    0035 %
    0036 %   - nu_B2: Bound on the norm of the operator A, i.e.
    0037 %       ||A x||^2 <= nu * ||x||^2 (default = 1).
    0038 %
    0039 %   - tol_B2: Tolerance for the projection onto the L2 ball. The algorithms
    0040 %       stops if
    0041 %         epsilon/(1-tol) <= ||y - A z||_2 <= epsilon/(1+tol)
    0042 %       (default = 1e-3).
    0043 %
    0044 %   - max_iter_B2: Maximum number of iterations for the projection onto the
    0045 %       L2 ball (default = 200).
    0046 %
    0047 %   - pos_B2: Positivity flag (1 to impose positivity, 0 otherwise;
    0048 %       default = 0).
    0049 %
    0050 %   - real_B2: Reality flag (1 to impose reality, 0 otherwise;
    0051 %       default = 0).
    0052 %
    0053 % References:
    0054 % [1] P. L. Combettes and J-C. Pesquet, "A Douglas-Rachford Splitting
    0055 % Approach to Nonsmooth Convex Variational Signal Recovery", IEEE Journal
    0056 % of Selected Topics in Signal Processing, vol. 1, no. 4, pp. 564-574, 2007.
    0057
    0058 % Optional input arguments
    0059 if ~isfield(param, 'verbose'), param.verbose = 1; end
    0060 if ~isfield(param, 'rel_obj'), param.rel_obj = 1e-4; end
    0061 if ~isfield(param, 'max_iter'), param.max_iter = 200; end
    0062 if ~isfield(param, 'gamma'), param.gamma = 1e-2; end
    0063 if ~isfield(param, 'weights'), param.weights = 1; end
    0064
    0065 % Input arguments for projection onto the L2 ball
    0066 param_B2.A = A; param_B2.At = At;
    0067 param_B2.y = y; param_B2.epsilon = epsilon;
    0068 param_B2.verbose = param.verbose;
    0069 if isfield(param, 'nu_B2'), param_B2.nu = param.nu_B2; end
    0070 if isfield(param, 'tol_B2'), param_B2.tol = param.tol_B2; end
    0071 if isfield(param, 'tight_B2'), param_B2.tight = param.tight_B2; end
    0072 if isfield(param, 'max_iter_B2')
    0073     param_B2.max_iter = param.max_iter_B2;
    0074 end
    0075 if isfield(param,'pos_B2'), param_B2.pos=param.pos_B2; end
    0076 if isfield(param,'real_B2'), param_B2.real=param.real_B2; end
    0077
    0078 % Initialization
    0079 if isfield(param,'initsol')
    0080     xhat = param.initsol;
    0081 else
    0082     xhat = At(y);
    0083 end
    0084
    0085 iter = 1; prev_norm = 0;
    0086
    0087 % Main loop
    0088 while 1
    0089
    0090     %
    0091     if param.verbose >= 1
    0092         fprintf('Iteration %i:\n', iter);
    0093     end
    0094
    0095     % Projection onto the L2-ball
    0096     [sol, param_B2.u] = sopt_mltb_fast_proj_B2(xhat, param_B2);
    0097
    0098     % Global stopping criterion
    0099     dummy = sol;
    0100     curr_norm = norm(param.weights(:).*dummy(:));
    0101     rel_norm = abs(curr_norm - prev_norm)/curr_norm;
    0102     if param.verbose >= 1
    0103         fprintf('  ||x||_1 = %e, rel_norm = %e\n', ...
    0104             curr_norm, rel_norm);
    0105     end
    0106     if (rel_norm < param.rel_obj)
    0107         crit_BPDN = 'REL_NORM';
    0108         break;
    0109     elseif iter >= param.max_iter
    0110         crit_BPDN = 'MAX_IT';
    0111         break;
    0112     end
    0113
    0114     % Proximal L2 operator
    0115     xhat = 2*sol - xhat;
    0116     temp = xhat ./ (1 + 2*param.weights);
    0117     xhat = temp + sol - xhat;
    0118
    0119     % Update variables
    0120     iter = iter + 1;
    0121     prev_norm = curr_norm;
    0122
    0123 end
    0124
    0125 % Log
    0126 if param.verbose >= 1
    0127
    0128     % L1 norm
    0129     fprintf('\n Solution found:\n');
    0130     fprintf(' Final L1 norm: %e\n', curr_norm);
    0131
    0132     % Residual
    0133     dummy = A(sol); res = norm(y(:)-dummy(:), 2);
    0134     fprintf(' epsilon = %e, ||y-Ax||_2=%e\n', epsilon, res);
    0135
    0136     % Stopping criterion
    0137     fprintf(' %i iterations\n', iter);
    0138     fprintf(' Stopping criterion: %s \n\n', crit_BPDN);
    0139
    0140 end
    0141
    0142 end