Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not activate TREGO by default #198

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 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,16 @@ 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() <= init_doe.nrows() + max_iters);
assert!(doe.nrows() >= init_doe.nrows());

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
Loading