ca553fbaa919f52c5c7643938254b3ff5d0caf18,ludwig/hyperopt/sampling.py,RandomSampler,__init__,#RandomSampler#Any#Any#Any#,120
Before Change
HyperoptSampler.__init__(self, goal, parameters)
params_for_join_space = copy.deepcopy(parameters)
for param_values in params_for_join_space.values():
if param_values[TYPE] == CATEGORY:
param_values[TYPE] = "cat"
if param_values[TYPE] == FLOAT:
param_values[TYPE] = "real"
if param_values[TYPE] == INT or param_values[TYPE] == "real":
if SPACE not in param_values:
param_values[SPACE] = "linear"
param_values["range"] = (param_values["low"],
param_values["high"])
del param_values["low"]
del param_values["high"]
After Change
HyperoptSampler.__init__(self, goal, parameters)
params_for_join_space = copy.deepcopy(parameters)
cat_params_values_types = {}
for param_name, param_values in params_for_join_space.items():
if param_values[TYPE] == CATEGORY:
param_values[TYPE] = "cat"
values_str = []
values_types = {}
for value in param_values["values"]:
value_str = str(value)
values_str.append(value_str)
value_type = type(value)
if value_type == bool:
value_type = str2bool
values_types[value_str] = value_type
param_values["values"] = values_str
cat_params_values_types[param_name] = values_types
if param_values[TYPE] == FLOAT:
param_values[TYPE] = "real"
if param_values[TYPE] == INT or param_values[TYPE] == "real":
if SPACE not in param_values:
param_values[SPACE] = "linear"
param_values["range"] = (param_values["low"],
param_values["high"])
del param_values["low"]
del param_values["high"]
self.cat_params_values_types = cat_params_values_types
self.space = JointSpace(params_for_join_space)
self.num_samples = num_samples
self.samples = self._determine_samples()
self.sampled_so_far = 0
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 38
Instances Project Name: uber/ludwig
Commit Name: ca553fbaa919f52c5c7643938254b3ff5d0caf18
Time: 2020-09-25
Author: w4nderlust@gmail.com
File Name: ludwig/hyperopt/sampling.py
Class Name: RandomSampler
Method Name: __init__
Project Name: uber/ludwig
Commit Name: ea07c8f2da9a4606c27d3c0410dbfcf189981045
Time: 2020-09-27
Author: w4nderlust@gmail.com
File Name: ludwig/hyperopt/sampling.py
Class Name: RandomSampler
Method Name: __init__
Project Name: uber/ludwig
Commit Name: ca553fbaa919f52c5c7643938254b3ff5d0caf18
Time: 2020-09-25
Author: w4nderlust@gmail.com
File Name: ludwig/hyperopt/sampling.py
Class Name: PySOTSampler
Method Name: __init__
Project Name: uber/ludwig
Commit Name: ea07c8f2da9a4606c27d3c0410dbfcf189981045
Time: 2020-09-27
Author: w4nderlust@gmail.com
File Name: ludwig/hyperopt/sampling.py
Class Name: PySOTSampler
Method Name: __init__