Description of sopt_mltb_solve_TVDN
Description: sopt_mltb_solve_TVDN - Solve TVDN problem

Home > matlab > sopt_mltb_solve_TVDN.m

# sopt_mltb_solve_TVDN

## PURPOSE

sopt_mltb_solve_TVDN - Solve TVDN problem

## SYNOPSIS

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

## DESCRIPTION

     sopt_mltb_solve_TVDN - Solve TVDN problem

     Solve the total variation denoising (TVDN) problem

       min ||x||_TV   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)||_TV - ||x(t-1)||_TV | / ||x(t)||_TV < rel_obj,
           where x(t) is the estimate of the solution at iteration t.

       - gamma: Convergence speed (weighting of TV norm when solving for
           TV proximal operator) (default = 1e-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).

       Proximal L1 operator:

       - max_iter_TV: Used as stopping criterion for the proximal TV
           operator. Maximun number of iterations (default = 200).

     References:
     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:

- Example_TVDN % Example_TVDN
- Example_TVDN2 % Example_TVDN2
- Experiment1 % Experiment1
- Experiment2 % Experiment2
- Experiment3 % Experiement3

## SOURCE CODE

    0001 function sol = sopt_mltb_solve_TVDN(y, epsilon, A, At, param)
    0002 % sopt_mltb_solve_TVDN - Solve TVDN problem
    0003 %
    0004 % Solve the total variation denoising (TVDN) problem
    0005 %
    0006 %   min ||x||_TV   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)||_TV - ||x(t-1)||_TV | / ||x(t)||_TV < rel_obj,
    0022 %       where x(t) is the estimate of the solution at iteration t.
    0023 %
    0024 %   - gamma: Convergence speed (weighting of TV norm when solving for
    0025 %       TV proximal operator) (default = 1e-1).
    0026 %
    0027 %   - initsol: Initial solution for a warmstart.
    0028 %
    0029 %   Projection onto the L2-ball:
    0030 %
    0031 %   - param.tight_B2: 1 if A is a tight frame or 0 otherwise (default = 1).
    0032 %
    0033 %   - nu_B2: Bound on the norm of the operator A, i.e.
    0034 %       ||A x||^2 <= nu * ||x||^2 (default = 1).
    0035 %
    0036 %   - tol_B2: Tolerance for the projection onto the L2 ball. The algorithms
    0037 %       stops if
    0038 %         epsilon/(1-tol) <= ||y - A z||_2 <= epsilon/(1+tol)
    0039 %       (default = 1e-3).
    0040 %
    0041 %   - max_iter_B2: Maximum number of iterations for the projection onto the
    0042 %       L2 ball (default = 200).
    0043 %
    0044 %   - pos_B2: Positivity flag (1 to impose positivity, 0 otherwise;
    0045 %       default = 0).
    0046 %
    0047 %   - real_B2: Reality flag (1 to impose reality, 0 otherwise;
    0048 %       default = 0).
    0049 %
    0050 %   Proximal L1 operator:
    0051 %
    0052 %   - max_iter_TV: Used as stopping criterion for the proximal TV
    0053 %       operator. Maximun number of iterations (default = 200).
    0054 %
    0055 % References:
    0056 % P. L. Combettes and J-C. Pesquet, "A Douglas-Rachford Splitting Approach
    0057 % to Nonsmooth Convex Variational Signal Recovery", IEEE Journal of
    0058 % Selected Topics in Signal Processing, vol. 1, no. 4, pp. 564-574, 2007.
    0059
    0060 % Optional input arguments
    0061 if ~isfield(param, 'verbose'), param.verbose = 1; end
    0062 if ~isfield(param, 'rel_obj'), param.rel_obj = 1e-4; end
    0063 if ~isfield(param, 'max_iter'), param.max_iter = 200; end
    0064 if ~isfield(param, 'gamma'), param.gamma = 1e-2; end
    0065
    0066 % Input arguments for projection onto the L2 ball
    0067 param_B2.A = A; param_B2.At = At;
    0068 param_B2.y = y; param_B2.epsilon = epsilon;
    0069 param_B2.verbose = param.verbose;
    0070 if isfield(param, 'nu_B2'), param_B2.nu = param.nu_B2; end
    0071 if isfield(param, 'tol_B2'), param_B2.tol = param.tol_B2; end
    0072 if isfield(param, 'tight_B2'), param_B2.tight = param.tight_B2; end
    0073 if isfield(param, 'max_iter_B2')
    0074     param_B2.max_iter = param.max_iter_B2;
    0075 end
    0076 if isfield(param,'pos_B2'), param_B2.pos=param.pos_B2; end
    0077 if isfield(param,'real_B2'), param_B2.real=param.real_B2; end
    0078
    0079 % Input arguments for prox TV
    0080 param_TV.verbose = param.verbose; param_TV.rel_obj = param.rel_obj;
    0081 if isfield(param, 'max_iter_TV')
    0082     param_TV.max_iter= param.max_iter_TV;
    0083 end
    0084
    0085 % Initialization
    0086 if isfield(param,'initsol')
    0087     xhat = param.initsol;
    0088 else
    0089     xhat = At(y);
    0090 end
    0091
    0092 iter = 1; prev_norm = 0;
    0093
    0094 % Main loop
    0095 while 1
    0096
    0097     if param.verbose>=1
    0098         fprintf('Iteration %i:\n', iter);
    0099     end
    0100
    0101     % Projection onto the L2-ball
    0102     [sol, param_B2.u] = sopt_mltb_fast_proj_B2(xhat, param_B2);
    0103
    0104     % Global stopping criterion
    0105     curr_norm = sopt_mltb_TV_norm(sol, 0);
    0106     rel_norm = abs(curr_norm - prev_norm)/curr_norm;
    0107     if param.verbose >= 1
    0108         fprintf('  ||x||_TV = %e, rel_norm = %e\n', ...
    0109             curr_norm, rel_norm);
    0110     end
    0111     if (rel_norm < param.rel_obj)
    0112         crit_BPDN = 'REL_NORM';
    0113         break;
    0114     elseif iter >= param.max_iter
    0115         crit_BPDN = 'MAX_IT';
    0116         break;
    0117     end
    0118
    0119     % Proximal L1 operator
    0120     xhat = 2*sol - xhat;
    0121     temp = sopt_mltb_prox_TV(xhat, param.gamma, param_TV);
    0122     xhat = temp + sol - xhat;
    0123
    0124     % Update variables
    0125     iter = iter + 1;
    0126     prev_norm = curr_norm;
    0127
    0128 end
    0129
    0130 % Log
    0131 if param.verbose >= 1
    0132
    0133     % L1 norm
    0134     fprintf('\n Solution found:\n');
    0135     fprintf(' Final TV norm: %e\n', curr_norm);
    0136
    0137     % Residual
    0138     temp = A(sol);
    0139     fprintf(' epsilon = %e, ||y-Ax||_2=%e\n', epsilon, ...
    0140         norm(y(:)-temp(:)));
    0141
    0142     % Stopping criterion
    0143     fprintf(' %i iterations\n', iter);
    0144     fprintf(' Stopping criterion: %s \n\n', crit_BPDN);
    0145
    0146 end
    0147
    0148 end