mlos_bench.optimizers.convert_configspace
Functions to convert TunableGroups to ConfigSpace for use with the mlos_core optimizers.
Classes
Enum for the kind of the tunable value (special or not). |
Functions
|
Remove the fields that correspond to special values in ConfigSpace. |
|
Check if name corresponds to a temporary ConfigSpace parameter. |
|
Remove the temporary suffix from a special parameter name. |
|
Generate the names of the auxiliary hyperparameters that correspond to a tunable |
Convert TunableGroups to hyperparameters in ConfigurationSpace. |
|
Converts a TunableGroups current values to a ConfigSpace Configuration. |
Module Contents
- class mlos_bench.optimizers.convert_configspace.TunableValueKind[source]
Enum for the kind of the tunable value (special or not).
It is not a true enum because ConfigSpace wants string values.
- mlos_bench.optimizers.convert_configspace.configspace_data_to_tunable_values(data: dict) Dict[str, mlos_bench.tunables.tunable.TunableValue] [source]
Remove the fields that correspond to special values in ConfigSpace.
In particular, remove and keys suffixes added by special_param_names.
- Parameters:
data (dict)
- Return type:
- mlos_bench.optimizers.convert_configspace.special_param_name_is_temp(name: str) bool [source]
Check if name corresponds to a temporary ConfigSpace parameter.
NOTE: ! characters are currently disallowed in Tunable names in order handle this logic.
- mlos_bench.optimizers.convert_configspace.special_param_name_strip(name: str) str [source]
Remove the temporary suffix from a special parameter name.
NOTE: ! characters are currently disallowed in Tunable names in order handle this logic.
- mlos_bench.optimizers.convert_configspace.special_param_names(name: str) Tuple[str, str] [source]
Generate the names of the auxiliary hyperparameters that correspond to a tunable that can have special values.
NOTE: ! characters are currently disallowed in Tunable names in order handle this logic.
- mlos_bench.optimizers.convert_configspace.tunable_groups_to_configspace(tunables: mlos_bench.tunables.tunable_groups.TunableGroups, seed: int | None = None) ConfigSpace.ConfigurationSpace [source]
Convert TunableGroups to hyperparameters in ConfigurationSpace.
- Parameters:
tunables (TunableGroups) – A collection of tunable parameters.
seed (Optional[int]) – Random seed to use.
- Returns:
configspace – A new ConfigurationSpace instance that corresponds to the input TunableGroups.
- Return type:
- mlos_bench.optimizers.convert_configspace.tunable_values_to_configuration(tunables: mlos_bench.tunables.tunable_groups.TunableGroups) ConfigSpace.Configuration [source]
Converts a TunableGroups current values to a ConfigSpace Configuration.
- Parameters:
tunables (TunableGroups) – The TunableGroups to take the current value from.
- Returns:
A ConfigSpace Configuration.
- Return type: