template<Config Conf>
struct alpaqa::detail::PANOCHelpers< Conf >
Definition at line 17 of file panoc-helpers.tpp.
|
static void | calc_err_z (const Problem &p, crvec x̂, crvec y, crvec Σ, rvec err_z) |
| Calculate the error between ẑ and g(x).
|
|
static bool | stop_crit_requires_grad_ψx̂ (PANOCStopCrit crit) |
|
static real_t | calc_error_stop_crit (const Problem &problem, PANOCStopCrit crit, crvec pₖ, real_t γ, crvec xₖ, crvec x̂ₖ, crvec ŷₖ, crvec grad_ψₖ, crvec grad_̂ψₖ, rvec work_n1, rvec work_n2) |
| Compute the ε from the stopping criterion, see PANOCStopCrit.
|
|
static real_t | descent_lemma (const Problem &problem, real_t rounding_tolerance, real_t L_max, crvec xₖ, real_t ψₖ, crvec grad_ψₖ, crvec y, crvec Σ, rvec x̂ₖ, rvec pₖ, rvec ŷx̂ₖ, real_t &ψx̂ₖ, real_t &norm_sq_pₖ, real_t &grad_ψₖᵀpₖ, real_t &Lₖ, real_t &γₖ) |
| Increase the estimate of the Lipschitz constant of the objective gradient and decrease the step size until quadratic upper bound or descent lemma is satisfied:
|
|
template<class ParamsT , class DurationT > |
static SolverStatus | check_all_stop_conditions (const ParamsT ¶ms, const InnerSolveOptions< config_t > &opts, DurationT time_elapsed, unsigned iteration, const AtomicStopSignal &stop_signal, real_t εₖ, unsigned no_progress) |
| Check all stop conditions (required tolerance reached, out of time, maximum number of iterations exceeded, interrupted by user, infinite iterate, no progress made)
|
|
static void | calc_augmented_lagrangian_hessian_prod_fd (const Problem &problem, crvec xₖ, crvec y, crvec Σ, crvec grad_ψ, crvec v, rvec Hv, rvec work_n1, rvec work_n2, rvec work_m) |
| Compute the Hessian matrix of the augmented Lagrangian function multiplied by the given vector, using finite differences.
|
|
static real_t | initial_lipschitz_estimate (const Problem &problem, crvec x, crvec y, crvec Σ, real_t ε, real_t δ, real_t L_min, real_t L_max, real_t &ψ, rvec grad_ψ, rvec work_x, rvec work_grad_ψ, rvec work_n, rvec work_m) |
| Estimate the Lipschitz constant of the gradient \( \nabla \psi \) using finite differences.
|
|
static real_t | initial_lipschitz_estimate (const Problem &problem, crvec xₖ, crvec y, crvec Σ, real_t ε, real_t δ, real_t L_min, real_t L_max, rvec grad_ψ, rvec work_n1, rvec work_n2, rvec work_n3, rvec work_m) |
| Estimate the Lipschitz constant of the gradient \( \nabla \psi \) using finite differences.
|
|
template<Config Conf>
static real_t descent_lemma |
( |
const Problem & |
problem, |
|
|
real_t |
rounding_tolerance, |
|
|
real_t |
L_max, |
|
|
crvec |
xₖ, |
|
|
real_t |
ψₖ, |
|
|
crvec |
grad_ψₖ, |
|
|
crvec |
y, |
|
|
crvec |
Σ, |
|
|
rvec |
x̂ₖ, |
|
|
rvec |
pₖ, |
|
|
rvec |
ŷx̂ₖ, |
|
|
real_t & |
ψx̂ₖ, |
|
|
real_t & |
norm_sq_pₖ, |
|
|
real_t & |
grad_ψₖᵀpₖ, |
|
|
real_t & |
Lₖ, |
|
|
real_t & |
γₖ |
|
) |
| |
|
inlinestatic |
Increase the estimate of the Lipschitz constant of the objective gradient and decrease the step size until quadratic upper bound or descent lemma is satisfied:
\[ \psi(x + p) \le \psi(x) + \nabla\psi(x)^\top p + \frac{L}{2} \|p\|^2 \]
The projected gradient iterate \( \hat x^k \) and step \( p^k \) are updated with the new step size \( \gamma^k \), and so are other quantities that depend on them, such as \( \nabla\psi(x^k)^\top p^k \) and \( \|p\|^2 \). The intermediate vector \( \hat y(x^k) \) can be used to compute the gradient \( \nabla\psi(\hat x^k) \) or to update the Lagrange multipliers.
- Returns
- The original step size, before it was reduced by this function.
- Parameters
-
[in] | problem | Problem description |
[in] | rounding_tolerance | Tolerance used to ignore rounding errors when the function \( \psi(x) \) is relatively flat or the step size is very small, which could cause \( \psi(x^k) < \psi(\hat x^k) \), which is mathematically impossible but could occur in finite precision floating point arithmetic. |
[in] | L_max | Maximum allowed Lipschitz constant estimate (prevents infinite loop if function or derivatives are discontinuous, and keeps step size bounded away from zero). |
[in] | xₖ | Current iterate \( x^k \) |
[in] | ψₖ | Objective function \( \psi(x^k) \) |
[in] | grad_ψₖ | Gradient of objective \( \nabla\psi(x^k) \) |
[in] | y | Lagrange multipliers \( y \) |
[in] | Σ | Penalty weights \( \Sigma \) |
[out] | x̂ₖ | Projected gradient iterate \( \hat x^k \) |
[out] | pₖ | Projected gradient step \( p^k \) |
[out] | ŷx̂ₖ | Intermediate vector \( \hat y(\hat x^k) \) |
[in,out] | ψx̂ₖ | Objective function \( \psi(\hat x^k) \) |
[in,out] | norm_sq_pₖ | Squared norm of the step \( \left\| p^k \right\|^2 \) |
[in,out] | grad_ψₖᵀpₖ | Gradient of objective times step \( \nabla\psi(x^k)^\top p^k\) |
[in,out] | Lₖ | Lipschitz constant estimate \( L_{\nabla\psi}^k \) |
[in,out] | γₖ | Step size \( \gamma^k \) |
Definition at line 152 of file panoc-helpers.tpp.
Compute the Hessian matrix of the augmented Lagrangian function multiplied by the given vector, using finite differences.
\[ \nabla^2_{xx} L_\Sigma(x, y)\, v \approx
\frac{\nabla_x L_\Sigma(x+hv, y) - \nabla_x L_\Sigma(x, y)}{h} \]
- Parameters
-
[in] | problem | Problem description |
[in] | xₖ | Current iterate \( x^k \) |
[in] | y | Lagrange multipliers \( y \) |
[in] | Σ | Penalty weights \( \Sigma \) |
[in] | grad_ψ | Gradient \( \nabla \psi(x^k) \) |
[in] | v | Vector to multiply with the Hessian |
[out] | Hv | Hessian-vector product |
| work_n1 | Dimension n |
| work_n2 | Dimension n |
| work_m | Dimension m |
Definition at line 256 of file panoc-helpers.tpp.