syne_tune.blackbox_repository.blackbox_tabular module
- class syne_tune.blackbox_repository.blackbox_tabular.BlackboxTabular(hyperparameters, configuration_space, fidelity_space, objectives_evaluations, fidelity_values=None, objectives_names=None)[source]
Bases:
BlackboxBlackbox that contains tabular evaluations (e.g. all hyperparameters evaluated on all fidelities). We use a separate class than
BlackboxOffline, as performance improvement can be made by avoiding to repeat hyperparameters and by storing all evaluations in a single table.Additional arguments on top of parent class
Blackbox:- Parameters:
hyperparameters (
DataFrame) – dataframe of hyperparameters, shape(num_evals, num_hps), columns must match hyperparameter names ofconfiguration_spaceobjectives_evaluations (
array) – values of recorded objectives, must have shape(num_evals, num_seeds, num_fidelities, num_objectives)fidelity_values (
Optional[array]) – values of thenum_fidelitiesfidelities, default to[1, ..., num_fidelities]
- property fidelity_values: array
- Returns:
Fidelity values; or None if the blackbox has none
- hyperparameter_objectives_values(predict_curves=False)[source]
If
predict_curvesis False, the shape ofXis(num_evals * num_seeds * num_fidelities, num_hps + 1), the shape ofyis(num_evals * num_seeds * num_fidelities, num_objectives). This can be reshaped to(num_fidelities, num_seeds, num_evals, *). The final column ofXis the fidelity value (only a single fidelity attribute is supported).If
predict_curvesis True, the shape ofXis(num_evals * num_seeds, num_hps), the shape ofyis(num_evals * num_seeds, num_fidelities * num_objectives). The latter can be reshaped to(num_seeds, num_evals, num_fidelities, num_objectives).- Parameters:
predict_curves (
bool) – See above. Default isFalse- Return type:
Tuple[DataFrame,DataFrame]- Returns:
Dataframes corresponding to
Xandy
- rename_objectives(objective_name_mapping)[source]
- Parameters:
objective_name_mapping (
Dict[str,str]) – dictionary from old objective name to new one, old objective name must be present in the blackbox- Return type:
- Returns:
a blackbox with as many objectives as
objective_name_mapping
- all_configurations()[source]
This method is useful in order to set
restrict_configurationsinStochasticAndFilterDuplicatesSearcherorGPFIFOSearcher, which restricts the searcher to only return configurations in this set. This allows you to use a tabular blackbox without a surrogate.- Return type:
List[Dict[str,Any]]- Returns:
List of all hyperparameter configurations for which objective values can be returned
- syne_tune.blackbox_repository.blackbox_tabular.deserialize(path)[source]
Deserialize blackboxes contained in a path that were saved with
serialize()above.TODO: the API is currently dissonant with
serialize(),deserialize()forBlackboxOfflineasserializeis a member function there. A possible way to unify is to have serialize also be a free function forBlackboxOffline.- Parameters:
path (
str) – a path that contains blackboxes that were saved withserialize()- Return type:
Dict[str,BlackboxTabular]- Returns:
a dictionary from task name to blackbox