Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update int_exponent_param.py #33

Merged
merged 1 commit into from
Dec 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions HEBO/hebo/design_space/int_exponent_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class IntExponentPara(Parameter):
def __init__(self, param_dict):
"""
Integer value, search in log-scale, and the exponent must be integer.
For example, parameter whose values must be one of [32, 64, 128, 512, 1024]
For example, parameter whose values must be one of [32, 64, 128, 256, 512, 1024]
"""
super().__init__(param_dict)
self.base = param_dict['base']
Expand All @@ -31,7 +31,7 @@ def transform(self, x):
return (np.log(x) / np.log(self.base))

def inverse_transform(self, x):
return (self.base ** x).astype(int)
return (self.base ** x.round().astype(int)).astype(int)

@property
def is_numeric(self):
Expand Down