From b4e09a25842985a4a0acea0c0f5c8789b7be125e Mon Sep 17 00:00:00 2001 From: Sam Wilson Date: Fri, 11 Feb 2022 09:49:10 -0500 Subject: [PATCH] fixed handling of scipy minimize result for 1.8 --- bayes_opt/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bayes_opt/util.py b/bayes_opt/util.py index a936221d8..6fb529f2a 100644 --- a/bayes_opt/util.py +++ b/bayes_opt/util.py @@ -62,9 +62,9 @@ def acq_max(ac, gp, y_max, bounds, random_state, n_warmup=10000, n_iter=10): continue # Store it if better than previous minimum(maximum). - if max_acq is None or -res.fun[0] >= max_acq: + if max_acq is None or -np.squeeze(res.fun) >= max_acq: x_max = res.x - max_acq = -res.fun[0] + max_acq = -np.squeeze(res.fun) # Clip output to make sure it lies within the bounds. Due to floating # point technicalities this is not always the case.