Skip to content

Commit

Permalink
Do not activate TREGO by default
Browse files Browse the repository at this point in the history
  • Loading branch information
relf committed Sep 30, 2024
1 parent ebdde79 commit 2f9162b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions ego/src/egor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,14 @@ mod tests {

#[test]
#[serial]
fn test_xsinx_wb2_egor_builder() {
fn test_xsinx_trego_wb2_egor_builder() {
let res = EgorBuilder::optimize(xsinx)
.configure(|config| {
config
.max_iters(20)
.regression_spec(RegressionSpec::ALL)
.correlation_spec(CorrelationSpec::ALL)
.trego(true)
.seed(1)
})
.min_within(&array![[0.0, 25.0]])
Expand All @@ -418,7 +419,7 @@ mod tests {

#[test]
#[serial]
fn test_xsinx_checkpoint_egor() {
fn test_xsinx_hot_start_egor() {
let _ = std::fs::remove_file(".checkpoints/egor.arg");
let n_iter = 1;
let res = EgorBuilder::optimize(xsinx)
Expand Down Expand Up @@ -532,7 +533,7 @@ mod tests {

#[test]
#[serial]
fn test_rosenbrock_2d_no_trego_egor_builder() {
fn test_rosenbrock_2d_trego_egor_builder() {
let outdir = "target/test_trego";
let _ = std::fs::remove_file(format!("{outdir}/{DOE_INITIAL_FILE}"));
let _ = std::fs::remove_file(format!("{outdir}/{DOE_FILE}"));
Expand All @@ -549,15 +550,15 @@ mod tests {
.max_iters(max_iters)
.outdir(outdir)
.seed(42)
.trego(false)
.trego(true)
})
.min_within(&xlimits)
.run()
.expect("Minimize failure");
let filepath = std::path::Path::new(&outdir).join(DOE_FILE);
assert!(filepath.exists());
let doe: Array2<f64> = read_npy(&filepath).expect("file read");
assert_eq!(doe.nrows(), init_doe.nrows() + max_iters); // we get one point per iter
assert!(doe.nrows() > max_iters);

println!("Rosenbrock optim result = {res:?}");
println!("Elapsed = {:?}", now.elapsed());
Expand Down
2 changes: 1 addition & 1 deletion ego/src/solver/egor_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub(crate) struct TregoConfig {
impl Default for TregoConfig {
fn default() -> Self {
TregoConfig {
activated: true,
activated: false,
n_local_steps: 4,
d: (1e-6, 1.),
beta: 0.9,
Expand Down

0 comments on commit 2f9162b

Please sign in to comment.