File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ namespace restart
119119
120120 struct TolX : Criterion
121121 {
122- static inline Float tolerance = 1e-12 ;
122+ static inline Float tolerance = 1e-11 ;
123123 Vector tolx_vector;
124124 TolX () : Criterion(" TolX" ) {}
125125 void update (const parameters::Parameters& p) override ;
@@ -135,7 +135,7 @@ namespace restart
135135
136136 struct MinDSigma : Criterion
137137 {
138- static inline Float tolerance = 1e-8 ;
138+ static inline Float tolerance = std::pow( 10 ., - 20 .) ;
139139 MinDSigma () : Criterion(" MinDSigma" ) {}
140140 void update (const parameters::Parameters& p) override ;
141141 };
@@ -149,14 +149,14 @@ namespace restart
149149
150150 struct NoEffectAxis : Criterion
151151 {
152- static inline Float tolerance = 0 . ;
152+ static inline Float tolerance = 10.0 * std::numeric_limits<Float>::epsilon() ;
153153 NoEffectAxis () : Criterion(" NoEffectAxis" ) {}
154154 void update (const parameters::Parameters& p) override ;
155155 };
156156
157157 struct NoEffectCoord : Criterion
158158 {
159- static inline Float tolerance = 0 . ;
159+ static inline Float tolerance = 10.0 * std::numeric_limits<Float>::epsilon() ;
160160 NoEffectCoord () : Criterion(" NoEffectCoord" ) {}
161161 void update (const parameters::Parameters& p) override ;
162162 };
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ namespace restart
119119 {
120120 const Float d_sigma = p.mutation ->sigma / p.settings .sigma0 ;
121121 const Float tolx_condition = tolerance * p.settings .sigma0 ;
122- tolx_vector.head (p.settings .dim ) = dynamic->C .diagonal () * d_sigma;
122+ tolx_vector.head (p.settings .dim ) = dynamic->C .diagonal (). cwiseSqrt () * d_sigma;
123123 tolx_vector.tail (p.settings .dim ) = dynamic->pc * d_sigma;
124124 met = (tolx_vector.array () < tolx_condition).all ();
125125 }
@@ -177,7 +177,7 @@ namespace restart
177177 if (const auto dynamic = std::dynamic_pointer_cast<matrix_adaptation::CovarianceAdaptation>(p.adaptation ))
178178 {
179179 const auto effect_coord = 0.2 * p.mutation ->sigma * dynamic->C .diagonal ().cwiseSqrt ();
180- met = (effect_coord.array ().abs () < tolerance).all ();
180+ met = (effect_coord.array ().abs () < tolerance).any ();
181181 }
182182 }
183183
@@ -201,7 +201,10 @@ namespace restart
201201 {
202202 const auto d = static_cast <Float>(p.settings .dim );
203203 const auto lambda = static_cast <Float>(p.lambda );
204- n_stagnation = (static_cast <size_t >(std::min (static_cast <int >(120 + (30 * d / lambda)), 20000 )));
204+ n_stagnation = static_cast <size_t >(
205+ 100 + 100 * std::pow (p.settings .dim , 1.5 ) / static_cast <Float>(p.lambda )
206+ );
207+
205208 median_fitnesses = {};
206209 best_fitnesses = {};
207210 }
You can’t perform that action at this time.
0 commit comments