Skip to content

Commit e91aa40

Browse files
committed
DOC: Bench: Fix 3rd-party methods seeds, n_calls, n_iter_no_change
1 parent 6493467 commit e91aa40

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

benchmark/methods.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def _minimize_nevergrad(fun, x0, *, bounds=None, constraints=None):
7474
instrumentation_params = ng.p.Array(init=x0)
7575
instrumentation = ng.p.Instrumentation(instrumentation_params)
7676

77-
optimizer = ng.optimizers.registry["NgIohTuned"](instrumentation, budget=2000)
78-
optimizer.register_callback('ask', ng.callbacks.EarlyStopping.no_improvement_stopper(1000))
77+
optimizer = ng.optimizers.registry["NgIohTuned"](instrumentation, budget=3000)
78+
optimizer.register_callback('ask', ng.callbacks.EarlyStopping.no_improvement_stopper(300))
7979

8080
def objective_with_nevergrad_expected_signature(*args):
8181
return fun(args[0], *args[1:])
@@ -116,7 +116,8 @@ def constrained_fun(x):
116116
best = fmin(fn=constrained_fun, space=space, trials=trials,
117117
algo=kwargs.get("algo", tpe.suggest),
118118
max_evals=kwargs.get("max_evals", 3000),
119-
early_stop_fn=no_progress_loss(500))
119+
early_stop_fn=no_progress_loss(500),
120+
rstate=np.random.default_rng(0))
120121
result = OptimizeResult(
121122
x=best,
122123
fun=trials.best_trial['result']['loss'],
@@ -139,11 +140,11 @@ def _minimize_skopt(fun, x0, *, bounds=None, constraints=None, **kwargs):
139140
# verbose=True,
140141
# callback=[DeltaYStopper(1e-1, 5), DeltaXStopper(.01)])
141142
res = skopt.forest_minimize(
142-
lambda x: fun(np.array(x)), bounds, n_calls=800,
143+
lambda x: fun(np.array(x)), bounds, n_calls=3000,
143144
space_constraint=constraints and (lambda x: constraints(np.array(x))),
144145
n_initial_points=50 * len(bounds),
145146
verbose=True,
146-
callback=HollowIterationsStopper(100, .1))
147+
callback=HollowIterationsStopper(150, .1))
147148
res['message'] = 'mock success'
148149
res['nfev'] = len(res.x_iters)
149150
res['success'] = True

0 commit comments

Comments
 (0)