Skip to content

Commit 317f735

Browse files
zhangchuangnankaifmfn
authored andcommitted
Update helpers.py (#84)
* Update helpers.py May be fail to minimize,the minimize will return res.fun with a array(0.0), and get res.fun will get an Exception * Update helpers.py Thanks to fmfn's advice: Can you change to if not res.success:? This is more pythonic.
1 parent bd5d4fe commit 317f735

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bayes_opt/helpers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ def acq_max(ac, gp, y_max, bounds, random_state, n_warmup=100000, n_iter=250):
5959
bounds=bounds,
6060
method="L-BFGS-B")
6161

62+
# See if success
63+
if not res.success:
64+
continue
65+
6266
# Store it if better than previous minimum(maximum).
6367
if max_acq is None or -res.fun[0] >= max_acq:
6468
x_max = res.x

0 commit comments

Comments
 (0)