GridSearchTuner will search all the possible configures that the user define in the searchSpace.
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 '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.
Type 'quniform' will receive three values [low, high, q], where [low, high] specifies a range and 'q' specifies the interval
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 'interval' larger than the value in front of it.
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 'qloguniform' behaves like 'quniform' except that it will first change the range to [log(low), log(high)]
Type 'randint' gives all possible intergers in range[low, high). Note that 'high' is not included.
and sample and then change the sampled value back.
'''
'''
def__init__(self):
def__init__(self):
...
@@ -73,8 +71,12 @@ class GridSearchTuner(Tuner):
...
@@ -73,8 +71,12 @@ class GridSearchTuner(Tuner):
chosen_params.extend(choice)
chosen_params.extend(choice)
else:
else:
chosen_params.append(choice)
chosen_params.append(choice)
elif_type=='quniform':
chosen_params=self._parse_quniform(_value)
elif_type=='randint':
chosen_params=self._parse_randint(_value)
else:
else:
chosen_params=self.parse_qtype(_type,_value)
raiseRuntimeError("Not supported type: %s"%_type)
else:
else:
chosen_params=dict()
chosen_params=dict()
forkeyinss_spec.keys():
forkeyinss_spec.keys():
...
@@ -95,21 +97,13 @@ class GridSearchTuner(Tuner):
...
@@ -95,21 +97,13 @@ 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'''