GridSearchTuner will search all the possible configures that the user define in the searchSpace.
The only acceptable types of search space are 'quniform', 'qloguniform' and 'choice'
The only acceptable types of search space are 'choice', 'quniform', 'randint'
Type 'choice' will select one of the options. Note that it can also be nested.
Type 'quniform' will receive three values [low, high, q], where [low, high] specifies a range and 'q' specifies the number of values that will be sampled evenly.
Note that q should be at least 2.
It will be sampled in a way that the first sampled value is 'low', and each of the following values is (high-low)/q larger that the value in front of it.
Type 'quniform' will receive three values [low, high, q], where [low, high] specifies a range and 'q' specifies the interval
It will be sampled in a way that the first sampled value is 'low', and each of the following values is 'interval' larger than the value in front of it.
Type 'qloguniform' behaves like 'quniform' except that it will first change the range to [log(low), log(high)]
and sample and then change the sampled value back.
Type 'randint' gives all possible intergers in range[low, high). Note that 'high' is not included.
'''
def__init__(self):
...
...
@@ -73,8 +71,12 @@ class GridSearchTuner(Tuner):
chosen_params.extend(choice)
else:
chosen_params.append(choice)
elif_type=='quniform':
chosen_params=self._parse_quniform(_value)
elif_type=='randint':
chosen_params=self._parse_randint(_value)
else:
chosen_params=self.parse_qtype(_type,_value)
raiseRuntimeError("Not supported type: %s"%_type)
else:
chosen_params=dict()
forkeyinss_spec.keys():
...
...
@@ -95,21 +97,13 @@ class GridSearchTuner(Tuner):
def_parse_quniform(self,param_value):
'''parse type of quniform parameter and return a list'''
ifparam_value[2]<2:
raiseRuntimeError("The number of values sampled (q) should be at least 2")