Loading...
Searching...
No Matches
ScaleFreeTrustRegion.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) gpridge developers
3// See LICENSE for details.
4
21
22#ifndef GPR_ML_SCALEFREETRUSTREGION_H_
23#define GPR_ML_SCALEFREETRUSTREGION_H_
24
25#include <Eigen/Dense>
26#include <limits>
27#include <vector>
28
30
31namespace gpr {
32
38double medianPairwiseDistance(const EigenMatrix& R_train);
39
42 double tau = 0.5;
43 double rho_grow = 0.75;
44 double rho_shrink = 0.25;
45 double grow_factor = 2.0;
46 double shrink_factor = 0.5;
47 double radius_floor = 1.0e-6;
48 double radius_ceiling = std::numeric_limits<double>::infinity();
51};
52
57public:
59 explicit ScaleFreeTrustRegion(const ScaleFreeTrustConfig& cfg) : cfg_(cfg)
60 {
61 }
62
64 void initFromTrainingSpread(double median_pairwise_spread);
65
67 void raiseCeiling(double ceiling);
68
69 double radius() const
70 {
71 return radius_;
72 }
73 double spread() const
74 {
75 return spread_;
76 }
77 double tau() const
78 {
79 return cfg_.tau;
80 }
82 {
83 return cfg_;
84 }
85
89 double updateRadiusFromRho(double actual_change, double predicted_change);
90
95 double updateRadiusFromRhoValue(double rho);
96
99 bool stepWithinVarianceFloor(double predicted_sigma,
100 double max_grad_component) const;
101
102private:
104 double radius_ = 0.0;
105 double spread_ = 0.0;
106};
107
110 bool force_ok = false;
111 bool variance_ok = false;
112 bool certified = false;
113};
114
122 double true_pes_saddle_force, double conv_tol,
123 const std::vector<double>& per_image_variance, double variance_envelope);
124
125} // namespace gpr
126
127#endif // GPR_ML_SCALEFREETRUSTREGION_H_
double updateRadiusFromRhoValue(double rho)
void raiseCeiling(double ceiling)
Raise the ceiling. A later spread initialization can then reach it.
bool stepWithinVarianceFloor(double predicted_sigma, double max_grad_component) const
ScaleFreeTrustRegion(const ScaleFreeTrustConfig &cfg)
double updateRadiusFromRho(double actual_change, double predicted_change)
void initFromTrainingSpread(double median_pairwise_spread)
Anchor the radius to tau * spread, clamped to [floor, ceiling].
const ScaleFreeTrustConfig & config() const
Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
Definition Macros.h:16
SaddleCertificate certifyFinalSaddle(double true_pes_saddle_force, double conv_tol, const std::vector< double > &per_image_variance, double variance_envelope)
Combined force and variance criterion for callers that request it. The variance envelope is an option...
double medianPairwiseDistance(const EigenMatrix &R_train)
Median of the strict-upper-triangle pairwise Euclidean row distances over a training set....
Eigen::Matrix< double, EigenDynamic, EigenDynamic, EigenMatrixStorage > EigenMatrix
Definition Macros.h:20
Final-saddle certificate, split from the exploration radius.
bool certified
force_ok && variance_ok
bool variance_ok
all-image posterior var <= envelope
bool force_ok
true-PES saddle force < conv_tol
Dimensionless knobs. All O(1) and metric-independent by construction.
double shrink_factor
0 < shrink_factor < 1
double tau
radius = tau * median spread (dimensionless)
double rho_grow
grow when rho > rho_grow (TREGO)
double variance_floor_kappa
Restricted variance: accept iff sigma_pred <= kappa * max|grad comp|.
double rho_shrink
shrink when rho < rho_shrink (TREGO)