1737f463aSAlp Dener /* 26e9726d0SXiang Huang Context for Bounded Regularized Gauss-Newton algorithm. 36e9726d0SXiang Huang Extended with L1-regularizer with a linear transformation matrix D: 46e9726d0SXiang Huang 0.5*||Ax-b||^2 + lambda*||D*x||_1 56e9726d0SXiang Huang When D is an identity matrix, we have the classic lasso, aka basis pursuit denoising in compressive sensing problem. 6737f463aSAlp Dener */ 7737f463aSAlp Dener 8a4963045SJacob Faibussowitsch #pragma once 9737f463aSAlp Dener 108e85b1b3SXiang Huang #include <../src/tao/bound/impls/bnk/bnk.h> /* BNLS, a sub-type of BNK, is used in brgn solver */ 11737f463aSAlp Dener 12*34b254c5SRichard Tran Mills #define BRGN_REGULARIZATION_USER 0 13*34b254c5SRichard Tran Mills #define BRGN_REGULARIZATION_L2PROX 1 14*34b254c5SRichard Tran Mills #define BRGN_REGULARIZATION_L2PURE 2 15*34b254c5SRichard Tran Mills #define BRGN_REGULARIZATION_L1DICT 3 16*34b254c5SRichard Tran Mills #define BRGN_REGULARIZATION_LM 4 17*34b254c5SRichard Tran Mills #define BRGN_REGULARIZATION_TYPES 5 18*34b254c5SRichard Tran Mills 19737f463aSAlp Dener typedef struct { 20a3c390cfSAlp Dener PetscErrorCode (*regularizerobjandgrad)(Tao, Vec, PetscReal *, Vec, void *); 21a3c390cfSAlp Dener PetscErrorCode (*regularizerhessian)(Tao, Vec, Mat, void *); 22a3c390cfSAlp Dener void *reg_obj_ctx; 23a3c390cfSAlp Dener void *reg_hess_ctx; 2430eeff36SXiang Huang Mat H, Hreg, D; /* Hessian, Hessian for regulization part, and Dictionary matrix have size N*N, and K*N respectively. (Jacobian M*N not used here) */ 258e85b1b3SXiang Huang Vec x_old, x_work, r_work, diag, y, y_work; /* x, r=J*x, and y=D*x have size N, M, and K respectively. */ 26cd1c4666STristan Konolige Vec damping; /* Optional diagonal damping matrix. */ 27e1e80dc8SAlp Dener Tao subsolver, parent; 28cd1c4666STristan Konolige PetscReal lambda, epsilon, fc_old; /* lambda is regularizer weight for both L2-norm Gaussian-Newton and L1-norm, ||x||_1 is approximated with sum(sqrt(x.^2+epsilon^2)-epsilon)*/ 29cd1c4666STristan Konolige PetscReal downhill_lambda_change, uphill_lambda_change; /* With the lm regularizer lambda diag(J^T J), 30cd1c4666STristan Konolige lambda = downhill_lambda_change * lambda on steps that decrease the objective. 31cd1c4666STristan Konolige lambda = uphill_lambda_change * lambda on steps that increase the objective. */ 32a3c390cfSAlp Dener PetscInt reg_type; 335eb5f4d6SAlp Dener PetscBool mat_explicit; 34737f463aSAlp Dener } TAO_BRGN; 35