#include <gpr/ml/RgminOpt.h>
Public Member Functions | |
| void | setAlgorithmSettings (const gpr::ScgOptimizationSettings &s) |
| void | setMethod (rgmin::Method m) noexcept |
| void | setMethod (rgmin_method_t m) noexcept |
| rgmin::Method | getMethod () const noexcept |
| void | setMemory (std::size_t m) noexcept |
| std::size_t | lbfgsPairCap () const noexcept |
| std::size_t | appliedLbfgsMemoryForTesting () const noexcept |
| void | setMaxMove (double m) noexcept |
| void | setGradTol (double g) noexcept |
| void | setBox (Eigen::VectorXd lower, Eigen::VectorXd upper) |
| Coordinate box on x + p. Empty is unbounded on that side. | |
| void | setPersistentSession (bool keep) noexcept |
| void | setInitialLogMove (double distance) noexcept |
| void | setInitialLogMoveWholeSession (bool whole_session) noexcept |
| void | forgetSession () noexcept |
| Drop the retained memory: the next fit starts cold. | |
| std::size_t | warmStarts () const noexcept |
| std::size_t | warmPairs () const noexcept |
| std::size_t | logicalObjectiveWork () const noexcept |
| Objective-count units for the fit under a single-entry request cache. | |
| std::size_t | physicalObjectiveWork () const noexcept |
| Executed objective-count units, including final holder restoration. | |
| template<typename ClassName, typename FuncName> | |
| void | optimize (const gpr::EigenMatrix &x, const Eigen::VectorXd &x_ind, const Eigen::VectorXd &y, Eigen::VectorXd &w, FuncName func_to_min, ClassName &holder, double, const Eigen::VectorXd &lengthscale_rho0=Eigen::VectorXd(), const MapObjectiveConfig *objective_config=nullptr) |
| template<typename ClassName, typename FuncName> | |
| void | optimizeWithObjectiveValues (const gpr::EigenMatrix &x, const Eigen::VectorXd &x_ind, const Eigen::VectorXd &y, Eigen::VectorXd &w, FuncName func_to_min, ClassName &holder, double barrier_strength, const Eigen::VectorXd &lengthscale_rho0, const MapObjectiveConfig *objective_config, double *opening_value_out, double *last_value_out) |
Static Public Member Functions | |
| static bool | methodFromName (const char *name, rgmin_method_t &out) noexcept |
Public Attributes | |
| bool | failedOptim = false |
| bool | exhaustedIterationBudget = false |
| int | completedIterations = 0 |
Gradient-only rgmin session on the MAP objective. The solver axis is rgmin::optimize::Method. MAP_LBFGS selects L-BFGS. The C ABI is the hourglass; this class drives the RAII wrap. RgminScg stays separate: rgmin_minimize_scg takes SCG parameters and a curvature callback the generic entry does not carry.
Newton and RFO need an analytic Hessian of the marginal likelihood, which this objective does not supply.
Definition at line 38 of file RgminOpt.h.
|
inlinenodiscardnoexcept |
Pair cap installed on the session of the last fit. Zero before that fit.
Definition at line 122 of file RgminOpt.h.
|
inlinenoexcept |
Drop the retained memory: the next fit starts cold.
Definition at line 182 of file RgminOpt.h.
|
inlinenodiscardnoexcept |
Definition at line 57 of file RgminOpt.h.
|
inlinenodiscardnoexcept |
Definition at line 116 of file RgminOpt.h.
|
inlinenodiscardnoexcept |
Objective-count units for the fit under a single-entry request cache.
Definition at line 204 of file RgminOpt.h.
|
inlinestaticnodiscardnoexcept |
Map a rgmin:<method> spelling onto the solver enum.
Newton and RFO are absent on purpose: both need an analytic Hessian of the marginal likelihood, which the MAP objective does not supply. Accepting their names here would build a session that cannot take a step.
Definition at line 68 of file RgminOpt.h.
| void funcmin::RgminOpt::optimize | ( | const gpr::EigenMatrix & | x, |
| const Eigen::VectorXd & | x_ind, | ||
| const Eigen::VectorXd & | y, | ||
| Eigen::VectorXd & | w, | ||
| FuncName | func_to_min, | ||
| ClassName & | holder, | ||
| double | current_barrier_strength, | ||
| const Eigen::VectorXd & | lengthscale_rho0 = Eigen::VectorXd(), | ||
| const MapObjectiveConfig * | objective_config = nullptr ) |
Definition at line 19 of file RgminOpt.inl.
| void funcmin::RgminOpt::optimizeWithObjectiveValues | ( | const gpr::EigenMatrix & | x, |
| const Eigen::VectorXd & | x_ind, | ||
| const Eigen::VectorXd & | y, | ||
| Eigen::VectorXd & | w, | ||
| FuncName | func_to_min, | ||
| ClassName & | holder, | ||
| double | barrier_strength, | ||
| const Eigen::VectorXd & | lengthscale_rho0, | ||
| const MapObjectiveConfig * | objective_config, | ||
| double * | opening_value_out, | ||
| double * | last_value_out ) |
Definition at line 31 of file RgminOpt.inl.
|
inlinenodiscardnoexcept |
Executed objective-count units, including final holder restoration.
Definition at line 209 of file RgminOpt.h.
|
inline |
Definition at line 44 of file RgminOpt.h.
|
inline |
Coordinate box on x + p. Empty is unbounded on that side.
Definition at line 136 of file RgminOpt.h.
|
inlinenoexcept |
Definition at line 130 of file RgminOpt.h.
|
inlinenoexcept |
Largest distance the first step of a cold session may move the parameters. Hyperparameters live in log coordinates, so one unit is a factor e in a length scale or an amplitude, and the objective is only meaningful near the start. The opening step of the session is not the unit step along the negative gradient when the gradient is large: the first step is capped through the solver's Euclidean move cap, which the line searches and trust radii honour, and the caller's cap is restored after it. Zero leaves the first step to the solver.
Definition at line 167 of file RgminOpt.h.
|
inlinenoexcept |
How the bound is applied. True (default): the opening step of the session control is lowered so the first trial of a cold session moves at most the bound, set from the gradient norm at the cold start, and it stays lowered for the life of the session, so every line search of the session opens there. False: only the first step of a cold session is capped, through the solver's move cap.
Definition at line 177 of file RgminOpt.h.
|
inlinenoexcept |
Definition at line 126 of file RgminOpt.h.
|
inlinenoexcept |
L-BFGS pairs kept by the solver and by the warm-start record. Zero selects the cap rgmin publishes as the default of OptimizeControl::memory, which is also the cap the C ABI uses when a control's memory is 0.
Definition at line 112 of file RgminOpt.h.
|
inlinenoexcept |
Definition at line 49 of file RgminOpt.h.
|
inlinenoexcept |
Definition at line 53 of file RgminOpt.h.
|
inlinenoexcept |
Transplant the previous fit's record into the next fit (off by default: every fit then opens a fresh session at the previous optimum with the cold opening step). A sequence of marginal likelihood fits, one per acquisition, minimises objectives that differ by the rows added since the last: the accepted steps of the previous fit, as curvature pairs, still describe the curvature at its optimum. Every fit opens a fresh session (its opening step is scaled to the new gradient); a warm start transplants the pairs into it when the record describes this objective (see warmPairs), and a caller that has found measured rows contradicting the posterior drops the record first (forgetSession). A changed dimension, method, tolerance, step cap or active subspace starts cold, and so does the fit after one that did not converge.
Definition at line 154 of file RgminOpt.h.
|
inlinenodiscardnoexcept |
Curvature pairs the last fit took from the previous fit's record: zero when the record was dropped as another objective's (the move it proposes for the new gradient exceeds the opening trust, or the decrease it claims exceeds one nat per parameter).
Definition at line 198 of file RgminOpt.h.
|
inlinenodiscardnoexcept |
Fits that opened after a converged fit of a compatible session (the previous optimum as start; the record consulted when transplanting).
Definition at line 190 of file RgminOpt.h.
| int funcmin::RgminOpt::completedIterations = 0 |
Definition at line 42 of file RgminOpt.h.
| bool funcmin::RgminOpt::exhaustedIterationBudget = false |
Definition at line 41 of file RgminOpt.h.
| bool funcmin::RgminOpt::failedOptim = false |
Definition at line 40 of file RgminOpt.h.