Skip to content

Commit a2229f8

Browse files
committed
Fix optim_g24 with new API, keep it minimal
1 parent 6d3c5dc commit a2229f8

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

python/egobox/examples/optim_g24.py

+5-12
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,15 @@ def g24(point):
5050
return np.array([G24(p), G24_c1(p), G24_c2(p)]).T
5151

5252

53+
# Configure the optimizer. See help(egor) for options
5354
egor = egx.Egor(
54-
g24,
5555
xspecs_g24,
5656
n_doe=10,
5757
n_cstr=n_cstr_g24,
58-
cstr_tol=1e-3,
58+
cstr_tol=[1e-3] * n_cstr_g24,
5959
infill_strategy=egx.InfillStrategy.WB2,
60-
# expected=egx.ExpectedOptimum(val=-5.50, tol=1e-2),
61-
# outdir="./out",
62-
# hot_start=True
63-
) # see help(egor) for options
60+
target=-5.50, # known reference objective value
61+
)
6462

65-
# Restrict regression and correlation models used
66-
# egor = egx.Egor(g24, xlimits_g24, n_cstr=n_cstr_g24, n_doe=10,
67-
# regr_spec=egx.RegressionSpec.LINEAR,
68-
# corr_spec=egx.CorrelationSpec.MATERN32 | egx.CorrelationSpec.MATERN52)
69-
70-
res = egor.minimize(max_iters=30)
63+
res = egor.minimize(g24, max_iters=30)
7164
print(f"Optimization f={res.y_opt} at {res.x_opt}")

0 commit comments

Comments
 (0)