Skip to content

Commit

Permalink
Update sampler.py
Browse files Browse the repository at this point in the history
  • Loading branch information
eukaryo authored Dec 4, 2024
1 parent f4d5aa0 commit b714476
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions package/samplers/hebo_base_sampler/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,18 @@ def sample_relative(
self._convert_to_hebo_design_space(search_space), scramble_seed=self._seed
)
for t in trials:
hebo_params = {name: t.params[name] for name in search_space.keys()}
if t.state == TrialState.COMPLETE:
hebo_params = {name: t.params[name] for name in search_space.keys()}
hebo.observe(
pd.DataFrame([hebo_params]),
np.asarray([map(lambda x: x * sign, t.values)]),
np.asarray([x * sign for x in t.values]),
)
elif t.state == TrialState.RUNNING:
try:
hebo_params = {name: t.params[name] for name in search_space.keys()}
except:
# There are params which is not suggested yet.
continue
# If `constant_liar == True`, assume that the RUNNING params result in bad values,
# thus preventing the simultaneous suggestion of (almost) the same params
# during parallel execution.
Expand Down

0 comments on commit b714476

Please sign in to comment.