Namespace for the one-dimensional line searches used by the descent optimizers.
More...
|
| std::string | name (const Method method) |
| | Get the name of a line search strategy.
|
| template<typename Scalar> |
| Scalar | armijo_bound (const Scalar phi_0, const Scalar dphi_0, const Scalar alpha, const Settings< Scalar > &s, const Scalar c) |
| template<typename Scalar> |
| Scalar | cubic_minimizer (const Scalar a, const Scalar phi_a, const Scalar dphi_a, const Scalar b, const Scalar phi_b, const Scalar dphi_b) |
| template<typename Scalar, typename Phi> |
| bool | armijo (Phi &&phi, const Scalar phi_0, const Scalar dphi_0, Scalar &alpha, Scalar &phi_alpha, const Settings< Scalar > &s=Settings< Scalar >()) |
| | Backtracking line search enforcing the Armijo condition \( \phi(\alpha) \leq \phi(0) + c_1\alpha\phi'(0) \), with safeguarded quadratic interpolation of the trial steps.
|
| template<typename Scalar, typename Phi> |
| bool | goldstein (Phi &&phi, const Scalar phi_0, const Scalar dphi_0, Scalar &alpha, Scalar &phi_alpha, const Settings< Scalar > &s=Settings< Scalar >()) |
| | Line search enforcing the Goldstein conditions \( \phi(0) + (1-c)\alpha\phi'(0) \leq \phi(\alpha) \leq \phi(0) +
c\alpha\phi'(0) \), by expansion and bisection. Only function values are used.
|
| template<typename Scalar, typename Phi> |
| bool | strong_wolfe (Phi &&phi, const Scalar phi_0, const Scalar dphi_0, Scalar &alpha, Scalar &phi_alpha, Scalar &dphi_alpha, const Settings< Scalar > &s=Settings< Scalar >()) |
| | Line search enforcing the strong Wolfe conditions \( \phi(\alpha) \leq \phi(0) + c_1\alpha\phi'(0) \) and \( |\phi'(\alpha)| \leq c_2|\phi'(0)| \) (Nocedal and Wright, Algorithms 3.5 and 3.6), with cubic interpolation in the zoom phase.
|
| template<typename Scalar> |
| void | more_thuente_step (Scalar &stx, Scalar &fx, Scalar &dx, Scalar &sty, Scalar &fy, Scalar &dy, Scalar &stp, const Scalar fp, const Scalar dp, bool &brackt, const Scalar stpmin, const Scalar stpmax, const Scalar noise=0) |
| | Safeguarded step of the Moré-Thuente line search (MINPACK-2 dcstep). Computes a new trial step from the interval endpoints \((s_x, f_x, d_x) \), \( (s_y, f_y, d_y) \) and the current trial \((s_p, f_p, d_p) \), and updates the interval that contains a step satisfying the strong Wolfe conditions.
|
| template<typename Scalar, typename Phi> |
| bool | more_thuente (Phi &&phi, const Scalar phi_0, const Scalar dphi_0, Scalar &alpha, Scalar &phi_alpha, Scalar &dphi_alpha, const Settings< Scalar > &s=Settings< Scalar >()) |
| | Line search of Moré and Thuente (1994), as implemented in MINPACK-2 (dcsrch). It finds a step satisfying the strong Wolfe conditions by safeguarded cubic and quadratic interpolation, working on the auxiliary function \( \psi(\alpha) = \phi(\alpha) - \phi(0) -
c_1\alpha\phi'(0) \) until an interval with a suitable step is found.
|
| template<typename Scalar, typename Phi> |
| bool | search (const Method method, Phi &&phi, const Scalar phi_0, const Scalar dphi_0, Scalar &alpha, Scalar &phi_alpha, Scalar &dphi_alpha, const Settings< Scalar > &s) |
| | Run the selected line search.
|
Line searches
Descent optimizers update the iterate as \(\mathbf{x}_{k+1} = \mathbf{x}_k + \alpha_k \mathbf{d}_k\), where \(\mathbf{d}_k\) is a descent direction, \(\nabla f(\mathbf{x}_k)^\top \mathbf{d}_k < 0\). The step \(\alpha_k\) is chosen by a line search on \(\phi(\alpha) = f(\mathbf{x}_k + \alpha\mathbf{d}_k)\). Four strategies are available in the Optimist::LineSearch namespace:
Close to a minimizer the decrease of \(\phi\) falls below its rounding error, so that a literal sufficient decrease test would reject every step. All searches therefore accept \(\phi(\alpha) \leq \phi(0) + c_1\alpha\phi'(0) + \epsilon_f|\phi(0)|\), and compare function values inside the bracket only above that level (below it, the derivative decides), in the spirit of the approximate Wolfe conditions of Hager and Zhang. The default \(\epsilon_f = 100\,\epsilon\) can be raised for cost functions evaluated with heavy cancellation.
The parameters ( \(c_1 = 10^{-4}\), \(c_2 = 0.9\), \(c = 0.25\), \(\epsilon_f\), maximum step and number of trials) are collected in LineSearch::Settings.
All line searches work on the restriction of the objective to the search direction, \( \phi(\alpha) = f(\mathbf{x} + \alpha\mathbf{d}) \), and are therefore independent of the vector type. The restriction is provided as a callable with signature
bool phi(Scalar alpha, Scalar &value, Scalar *derivative);
where derivative is nullptr when \( \phi'(\alpha) \) is not needed.