Commit afb4e78c authored by suiguoxin's avatar suiguoxin
Browse files

update gridsearch quniform to conform with BOHB

parent 05913424
...@@ -97,9 +97,8 @@ class GridSearchTuner(Tuner): ...@@ -97,9 +97,8 @@ class GridSearchTuner(Tuner):
def _parse_quniform(self, param_value): def _parse_quniform(self, param_value):
'''parse type of quniform parameter and return a list''' '''parse type of quniform parameter and return a list'''
low, high, interval = param_value[0], param_value[1], param_value[2] low, high, q = param_value[0], param_value[1], param_value[2]
count = int(np.floor((high - low) / interval)) + 1 return np.clip(np.arange(np.round(low/q), np.round(high/q)+1) * q, low, high)
return [low + interval * i for i in range(count)]
def _parse_randint(self, param_value): def _parse_randint(self, param_value):
'''parse type of randint parameter and return a list''' '''parse type of randint parameter and return a list'''
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment