Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nabenabe0928 committed Dec 10, 2024
1 parent 8f875fc commit b17824c
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions package/samplers/hebo/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,15 @@ def _suggest_and_transform_to_dict(
continue

dist = search_space[name]
if isinstance(dist, (IntDistribution, FloatDistribution)):
if not dist.log and dist.step is not None:
step_index = row.iloc[0]
params[name] = dist.low + step_index * dist.step
else:
params[name] = row.iloc[0]
elif isinstance(dist, CategoricalDistribution):
params[name] = row.iloc[0]
if (
isinstance(dist, (IntDistribution, FloatDistribution))
and not dist.log
and dist.step is not None
):
step_index = row.iloc[0]
params[name] = dist.low + step_index * dist.step
else:
assert False, f"Should not reach. Got an unknown distribution: {dist}."
params[name] = row.iloc[0]

return params

Expand Down

0 comments on commit b17824c

Please sign in to comment.