mlos_core.spaces.adapters package¶
Basic initializer module for the mlos_core space adapters.
- class mlos_core.spaces.adapters.IdentityAdapter(*, orig_parameter_space: ConfigurationSpace)¶
Bases:
BaseSpaceAdapter
Identity (no-op) SpaceAdapter class.
- Parameters:
- orig_parameter_spaceConfigSpace.ConfigurationSpace
The original parameter space to explore.
- Attributes:
orig_parameter_space
Original (user-provided) parameter space to explore.
target_parameter_space
Target parameter space that is fed to the underlying optimizer.
Methods
inverse_transform
(configurations)Translates a configuration, which belongs to the original parameter space, to the target parameter space.
transform
(configuration)Translates a configuration, which belongs to the target parameter space, to the original parameter space.
- inverse_transform(configurations: DataFrame) DataFrame ¶
Translates a configuration, which belongs to the original parameter space, to the target parameter space. This method is called by the register method of the BaseOptimizer class, and performs the inverse operation of BaseSpaceAdapter.transform method.
- Parameters:
- configurationspd.DataFrame
Dataframe of configurations / parameters, which belong to the original parameter space. The columns are the parameter names the original parameter space and the rows are the configurations.
- Returns:
- configurationspd.DataFrame
Dataframe of the translated configurations / parameters. The columns are the parameter names of the target parameter space and the rows are the configurations.
- property target_parameter_space: ConfigurationSpace¶
Target parameter space that is fed to the underlying optimizer.
- transform(configuration: DataFrame) DataFrame ¶
Translates a configuration, which belongs to the target parameter space, to the original parameter space. This method is called by the suggest method of the BaseOptimizer class.
- Parameters:
- configurationpd.DataFrame
Pandas dataframe with a single row. Column names are the parameter names of the target parameter space.
- Returns:
- configurationpd.DataFrame
Pandas dataframe with a single row, containing the translated configuration. Column names are the parameter names of the original parameter space.
- class mlos_core.spaces.adapters.LlamaTuneAdapter(*, orig_parameter_space: ConfigurationSpace, num_low_dims: int = 16, special_param_values: dict | None = None, max_unique_values_per_param: int | None = 10000, use_approximate_reverse_mapping: bool = False)¶
Bases:
BaseSpaceAdapter
Implementation of LlamaTune, a set of parameter space transformation techniques, aimed at improving the sample-efficiency of the underlying optimizer.
- Attributes:
orig_parameter_space
Original (user-provided) parameter space to explore.
target_parameter_space
Get the parameter space, which is explored by the underlying optimizer.
Methods
inverse_transform
(configurations)Translates a configuration, which belongs to the original parameter space, to the target parameter space.
transform
(configuration)Translates a configuration, which belongs to the target parameter space, to the original parameter space.
- DEFAULT_MAX_UNIQUE_VALUES_PER_PARAM = 10000¶
Default number of (max) unique values of each parameter, when space discretization is used.
- DEFAULT_NUM_LOW_DIMS = 16¶
Default number of dimensions in the low-dimensional search space, generated by HeSBO projection.
- DEFAULT_SPECIAL_PARAM_VALUE_BIASING_PERCENTAGE = 0.2¶
Default percentage of bias for each special parameter value.
- inverse_transform(configurations: DataFrame) DataFrame ¶
Translates a configuration, which belongs to the original parameter space, to the target parameter space. This method is called by the register method of the BaseOptimizer class, and performs the inverse operation of BaseSpaceAdapter.transform method.
- Parameters:
- configurationspd.DataFrame
Dataframe of configurations / parameters, which belong to the original parameter space. The columns are the parameter names the original parameter space and the rows are the configurations.
- Returns:
- configurationspd.DataFrame
Dataframe of the translated configurations / parameters. The columns are the parameter names of the target parameter space and the rows are the configurations.
- property target_parameter_space: ConfigurationSpace¶
Get the parameter space, which is explored by the underlying optimizer.
- transform(configuration: DataFrame) DataFrame ¶
Translates a configuration, which belongs to the target parameter space, to the original parameter space. This method is called by the suggest method of the BaseOptimizer class.
- Parameters:
- configurationpd.DataFrame
Pandas dataframe with a single row. Column names are the parameter names of the target parameter space.
- Returns:
- configurationpd.DataFrame
Pandas dataframe with a single row, containing the translated configuration. Column names are the parameter names of the original parameter space.