Skip to content

Commit 8b5f92f

Browse files
authored
Maintainance (#183)
* Remove derive_more * Update CHANGELOG * Increase trust region in case of EGO success * Improve TREGO logging * Test trego on rosenbrock 2d * Fix documentation * Increase maxiter to "ensure" optim test success
1 parent 657ed86 commit 8b5f92f

File tree

6 files changed

+46
-12
lines changed

6 files changed

+46
-12
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changes
22

3+
## Version 0.21.1 - 31/07/2024
4+
5+
* `gp`: Fix variance gradient computation by @relf in <https://github.com/relf/egobox/pull/177>
6+
7+
## Version 0.21.0 - 09/07/2024
8+
9+
* Implement [TREGO algorithm](https://arxiv.org/abs/2101.06808) by @relf in <https://github.com/relf/egobox/pull/173>
10+
* Fix added point count in TREGO local step by @relf in <https://github.com/relf/egobox/pull/174>
11+
* Fix WB2S criteria scaling factor and fmin computation by @relf in <https://github.com/relf/egobox/pull/175>
12+
* Prepare release 0.21 by @relf in <https://github.com/relf/egobox/pull/176>
13+
14+
## Version 0.20.0 - 25/06/2024
15+
16+
* Make `n_optmod` option available in Python by @relf in <https://github.com/relf/egobox/pull/161>
17+
* Add dependabot cargo ecosystem check by @relf in <https://github.com/relf/egobox/pull/163>
18+
* Save original parameters in trained `gp` models by @relf in <https://github.com/relf/egobox/pull/166>
19+
* Implement cross validation metric for surrogates by @relf in <https://github.com/relf/egobox/pull/167>
20+
* Better `Egor` solver state handling by @relf in <https://github.com/relf/egobox/pull/168>
21+
* Refactor `ego` module by @relf in <https://github.com/relf/egobox/pull/169>
22+
323
## Version 0.19.0 - 15/05/2024
424

525
* `ego`:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ Jones, D. R., Schonlau, M., & Welch, W. J. (1998). Efficient global optimization
195195
black-box functions. Journal of Global Optimization, 13(4), 455–492.
196196

197197
Diouane, Youssef, et al. "TREGO: a trust-region framework for efficient global optimization."
198-
Journal of Global Optimization 86.1 (2023): 1-23.
198+
Journal of Global Optimization 86.1 (2023): 1-23. <https://arxiv.org/pdf/2101.06808>
199199

200200
smtorg. (2018). Surrogate modeling toolbox. In GitHub repository. GitHub. <https://github.com/SMTOrg/smt>
201201

ego/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ serde_json = "1"
5757
typetag = { version = "0.2" }
5858
dyn-clonable = { version = "0.9" }
5959

60-
derive_more = "0.99"
6160

6261
[dev-dependencies]
6362
criterion = "0.5"

ego/src/egor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,14 +390,14 @@ mod tests {
390390

391391
#[test]
392392
#[serial]
393-
fn test_rosenbrock_2d_infill_target_egor_builder() {
393+
fn test_rosenbrock_2d_trego_egor_builder() {
394394
let now = Instant::now();
395395
let xlimits = array![[-2., 2.], [-2., 2.]];
396396
let doe = Lhs::new(&xlimits)
397397
.with_rng(Xoshiro256Plus::seed_from_u64(42))
398398
.sample(10);
399399
let res = EgorBuilder::optimize(rosenb)
400-
.configure(|config| config.doe(&doe).max_iters(20).seed(42))
400+
.configure(|config| config.doe(&doe).max_iters(20).seed(42).trego(true))
401401
.min_within(&xlimits)
402402
.run()
403403
.expect("Minimize failure");
@@ -445,7 +445,7 @@ mod tests {
445445
config
446446
.n_cstr(2)
447447
.doe(&doe)
448-
.max_iters(30)
448+
.max_iters(50)
449449
.cstr_tol(array![2e-6, 1e-6])
450450
.seed(42)
451451
})

ego/src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
//! The implementation relies on [Mixture of Experts](egobox_moe).
3939
//!
4040
//!
41-
//! ## Mixed-integer optmization
41+
//! ## Mixed-integer optimization
4242
//!
4343
//! While [Egor] optimizer works with continuous data (i.e floats), the optimizer
4444
//! allows to make basic mixed-integer optimization. The configuration of the Optimizer
@@ -181,14 +181,15 @@
181181
//! (2019). [A python surrogate modeling framework with derivatives](https://doi.org/10.1016/j.advengsoft.2019.03.005).
182182
//! Advances in Engineering Software, 102662.
183183
//!
184-
//! Dubreuil, S., Bartoli, N., Gogu, C., & Lefebvre, T. (2020). (Towards an efficient global multi-
185-
//! disciplinary design optimization algorithm)[https://doi.org/10.1007/s00158-020-02514-6].
184+
//! Dubreuil, S., Bartoli, N., Gogu, C., & Lefebvre, T. (2020). [Towards an efficient global multi-
185+
//! disciplinary design optimization algorithm](https://doi.org/10.1007/s00158-020-02514-6).
186186
//! Structural and Multidisciplinary Optimization, 62(4), 1739–1765.
187187
//!
188188
//! Jones, D. R., Schonlau, M., & Welch, W. J. (1998). Efficient global optimization of expensive
189189
//! black-box functions. Journal of Global Optimization, 13(4), 455–492.
190190
//!
191-
//! \[<a id="Diouane2023">Diouane(2023)</a>\]: Diouane, Youssef, et al. "TREGO: a trust-region framework for efficient global optimization."
191+
//! \[<a id="Diouane2023">Diouane(2023)</a>\]: Diouane, Youssef, et al.
192+
//! [TREGO: a trust-region framework for efficient global optimization](https://arxiv.org/pdf/2101.06808)
192193
//! Journal of Global Optimization 86.1 (2023): 1-23.
193194
//!
194195
//! smtorg. (2018). Surrogate modeling toolbox. In [GitHub repository](https://github.com/SMTOrg/smt)

ego/src/solver/egor_solver.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,16 @@ where
326326
let prev_best = state.prev_best_index.unwrap(); // initialized in init
327327

328328
// Check prev step success
329+
let diff = y_data[[prev_best, 0]] - rho(state.sigma);
330+
let last_iter_success = y_data[[best, 0]] < diff;
329331
info!(
330-
"success = {} as {} < {} - {}",
331-
y_data[[best, 0]] < (y_data[[prev_best, 0]] - rho(state.sigma)),
332+
"success = {} as {} {} {} - {}",
333+
last_iter_success,
332334
y_data[[best, 0]],
335+
if last_iter_success { "<" } else { ">=" },
333336
y_data[[prev_best, 0]],
334337
rho(state.sigma)
335338
);
336-
let last_iter_success = y_data[[best, 0]] < (y_data[[prev_best, 0]] - rho(state.sigma));
337339
let mut new_state = state.clone();
338340
if !state.prev_step_ego && state.get_iter() != 0 {
339341
// Adjust trust region wrt local step success
@@ -352,6 +354,18 @@ where
352354
old, new_state.sigma
353355
);
354356
}
357+
} else if state.get_iter() != 0 {
358+
// Adjust trust region wrt global step success
359+
if last_iter_success {
360+
let old = state.sigma;
361+
new_state.sigma *= self.config.trego.gamma;
362+
info!(
363+
"Previous EGO global step successful: sigma {} -> {}",
364+
old, new_state.sigma
365+
);
366+
} else {
367+
info!("Previous EGO global step not successful");
368+
}
355369
}
356370

357371
let is_global_phase = (last_iter_success && state.prev_step_ego)

0 commit comments

Comments
 (0)