alpaqa 1.0.0a14
Nonconvex constrained optimization
Loading...
Searching...
No Matches
panoc-stop-crit.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <iosfwd>
4#include <stdexcept>
5
6namespace alpaqa {
7
8enum class PANOCStopCrit {
9 /// Find an ε-approximate KKT point in the ∞-norm:
10 /// @f[
11 /// \varepsilon = \left\| \gamma_k^{-1} (x^k - \hat x^k) +
12 /// \nabla \psi(\hat x^k) - \nabla \psi(x^k) \right\|_\infty
13 /// @f]
14 ApproxKKT = 0,
15 /// Find an ε-approximate KKT point in the 2-norm:
16 /// @f[
17 /// \varepsilon = \left\| \gamma_k^{-1} (x^k - \hat x^k) +
18 /// \nabla \psi(\hat x^k) - \nabla \psi(x^k) \right\|_2
19 /// @f]
21 /// ∞-norm of the projected gradient with step size γ:
22 /// @f[
23 /// \varepsilon = \left\| x^k -
24 /// \Pi_C\left(x^k - \gamma_k \nabla \psi(x^k)\right) \right\|_\infty
25 /// @f]
27 /// 2-norm of the projected gradient with step size γ:
28 /// @f[
29 /// \varepsilon = \left\| x^k -
30 /// \Pi_C\left(x^k - \gamma_k \nabla \psi(x^k)\right) \right\|_2
31 /// @f]
32 /// This is the same criterion as used by
33 /// [OpEn](https://alphaville.github.io/optimization-engine/).
35 /// ∞-norm of the projected gradient with unit step size:
36 /// @f[
37 /// \varepsilon = \left\| x^k -
38 /// \Pi_C\left(x^k - \nabla \psi(x^k)\right) \right\|_\infty
39 /// @f]
41 /// 2-norm of the projected gradient with unit step size:
42 /// @f[
43 /// \varepsilon = \left\| x^k -
44 /// \Pi_C\left(x^k - \nabla \psi(x^k)\right) \right\|_2
45 /// @f]
47 /// ∞-norm of fixed point residual:
48 /// @f[
49 /// \varepsilon = \gamma_k^{-1} \left\| x^k -
50 /// \Pi_C\left(x^k - \gamma_k \nabla \psi(x^k)\right) \right\|_\infty
51 /// @f]
52 FPRNorm,
53 /// 2-norm of fixed point residual:
54 /// @f[
55 /// \varepsilon = \gamma_k^{-1} \left\| x^k -
56 /// \Pi_C\left(x^k - \gamma_k \nabla \psi(x^k)\right) \right\|_2
57 /// @f]
59 /// The stopping criterion used by Ipopt, see
60 /// https://link.springer.com/article/10.1007/s10107-004-0559-y equation (5).
61 ///
62 /// Given a candidate iterate @f$ \hat x^k @f$ and the corresponding
63 /// candidate Lagrange multipliers @f$ \hat y^k @f$ for the general
64 /// constraints @f$ g(x)\in D @f$,
65 /// the multipliers @f$ w @f$ for the box constraints @f$ x\in C @f$
66 /// (that are otherwise not computed explicitly) are given by
67 /// @f[
68 /// w^k = v^k - \Pi_C(v^k),
69 /// @f]
70 /// where
71 /// @f[ \begin{aligned}
72 /// v^k &\triangleq
73 /// \hat x^k - \nabla f(\hat x^k) - \nabla g(\hat x^k)\, \hat y^k \\ &=
74 /// \hat x^k - \nabla \psi(\hat x^k)
75 /// \end{aligned} @f]
76 /// The quantity that is compared to the (scaled) tolerance is then given by
77 /// @f[ \begin{aligned}
78 /// \varepsilon' &=
79 /// \left\|
80 /// \nabla f(\hat x^k) + \nabla g(\hat x^k)\, \hat y^k + w^k
81 /// \right\|_\infty \\ &=
82 /// \left\|
83 /// \hat x^k - \Pi_C\left(v^k\right)
84 /// \right\|_\infty
85 /// \end{aligned} @f]
86 /// Finally, the quantity is scaled by the factor
87 /// @f[
88 /// s_d \triangleq \max\left\{
89 /// s_\text{max},\;\frac{\|\hat y^k\|_1 + \|w^k\|_1}{2m + 2n}
90 /// \right\} / s_\text{max},
91 /// @f]
92 /// i.e. @f$ \varepsilon = \varepsilon' / s_d @f$.
93 Ipopt,
94 /// The stopping criterion used by LBFGS++, see
95 /// https://lbfgspp.statr.me/doc/classLBFGSpp_1_1LBFGSBParam.html#afb20e8fd6c6808c1f736218841ba6947
96 ///
97 /// @f[
98 /// \varepsilon = \frac{\left\| x^k -
99 /// \Pi_C\left(x^k - \nabla \psi(x^k)\right) \right\|_\infty}
100 /// {\max\left\{1, \|x\|_2 \right\}}
101 /// @f]
102 LBFGSBpp,
103};
104
105inline constexpr const char *enum_name(PANOCStopCrit s) {
106 switch (s) {
107 case PANOCStopCrit::ApproxKKT: return "ApproxKKT";
108 case PANOCStopCrit::ApproxKKT2: return "ApproxKKT2";
109 case PANOCStopCrit::ProjGradNorm: return "ProjGradNorm";
110 case PANOCStopCrit::ProjGradNorm2: return "ProjGradNorm2";
111 case PANOCStopCrit::ProjGradUnitNorm: return "ProjGradUnitNorm";
112 case PANOCStopCrit::ProjGradUnitNorm2: return "ProjGradUnitNorm2";
113 case PANOCStopCrit::FPRNorm: return "FPRNorm";
114 case PANOCStopCrit::FPRNorm2: return "FPRNorm2";
115 case PANOCStopCrit::Ipopt: return "Ipopt";
116 case PANOCStopCrit::LBFGSBpp: return "LBFGSBpp";
117 default:;
118 }
119 throw std::out_of_range("invalid value for alpaqa::PANOCStopCrit");
120}
121
122std::ostream &operator<<(std::ostream &os, PANOCStopCrit s);
123
124} // namespace alpaqa
@ LBFGSBpp
The stopping criterion used by LBFGS++, see https://lbfgspp.statr.me/doc/classLBFGSpp_1_1LBFGSBParam....
@ ProjGradUnitNorm
∞-norm of the projected gradient with unit step size:
@ ProjGradNorm
∞-norm of the projected gradient with step size γ:
@ Ipopt
The stopping criterion used by Ipopt, see https://link.springer.com/article/10.1007/s10107-004-0559-y...
@ FPRNorm2
2-norm of fixed point residual:
@ ProjGradNorm2
2-norm of the projected gradient with step size γ:
@ ApproxKKT
Find an ε-approximate KKT point in the ∞-norm:
@ FPRNorm
∞-norm of fixed point residual:
@ ApproxKKT2
Find an ε-approximate KKT point in the 2-norm:
@ ProjGradUnitNorm2
2-norm of the projected gradient with unit step size:
std::ostream & operator<<(std::ostream &os, PANOCStopCrit s)
constexpr const char * enum_name(LBFGSStepSize s)
Definition lbfgs.hpp:229