Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Fix 2 issues #5779

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions nni/algorithms/hpo/gp_tuner/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def acq_max(f_acq, gp, y_max, bounds, space, num_warmup, num_starting_points):
for x_try in x_seeds:
# Find the minimum of minus the acquisition function
res = minimize(lambda x: -f_acq(x.reshape(1, -1), gp=gp, y_max=y_max),
x_try.reshape(1, -1),
x_try,
bounds=bounds_minmax,
method="L-BFGS-B")

Expand All @@ -104,9 +104,9 @@ def acq_max(f_acq, gp, y_max, bounds, space, num_warmup, num_starting_points):
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 = _match_val_type(res.x, bounds)
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.
Expand Down
Loading