Skip to content

Commit

Permalink
Merge pull request #33 from kaimo455/patch-1
Browse files Browse the repository at this point in the history
Update int_exponent_param.py
  • Loading branch information
AntGro committed Dec 2, 2022
2 parents f9b7f57 + 45baee4 commit 6120559
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 6120559

Please sign in to comment.