syne_tune.optimizer.schedulers.searchers.bayesopt.datatypes.config_ext module
- class syne_tune.optimizer.schedulers.searchers.bayesopt.datatypes.config_ext.ExtendedConfiguration(hp_ranges, resource_attr_key, resource_attr_range)[source]
Bases:
objectThis class facilitates handling extended configs, which consist of a normal config and a resource attribute.
The config space hp_ranges is extended by an additional resource attribute. Note that this is not a hyperparameter we optimize over, but it is under the control of the scheduler. Its allowed range is
[1, resource_attr_range[1]], which can be larger than[resource_attr_range[0], resource_attr_range[1]]. This is because extended configs with resource values outside of resource_attr_range may arise (for example, in the early stopping context, we may receive data fromepoch < resource_attr_range[0]).- get(config, resource)[source]
Create extended config with resource added.
- Parameters:
config (
Dict[str,Union[str,float,int]]) – Non-extended configresource (
int) – Resource value
- Return type:
Dict[str,Union[str,float,int]]- Returns:
Extended config
- remove_resource(config_ext)[source]
Strips away resource attribute and returns normal config. If
config_extis already normal, it is returned as is.- Parameters:
config_ext (
Dict[str,Union[str,float,int]]) – Extended config- Return type:
Dict[str,Union[str,float,int]]- Returns:
config_extwithout resource attribute