ultraopt.utils package

Submodules

ultraopt.utils.config_space module

ultraopt.utils.config_space.CS2HyperoptSpace(cs: ConfigSpace.configuration_space.ConfigurationSpace)[源代码]

一个将configspace转hyperopt空间的函数

ultraopt.utils.config_space.add_configs_origin(configs: List[ConfigSpace.configuration_space.Configuration], origin)[源代码]
ultraopt.utils.config_space.deactivate(config_space, vector)[源代码]
ultraopt.utils.config_space.get_array_from_configs(configs: List[ConfigSpace.configuration_space.Configuration])[源代码]
ultraopt.utils.config_space.get_dict_from_config(config: Union[dict, ConfigSpace.configuration_space.Configuration])[源代码]
ultraopt.utils.config_space.initial_design(cs, n_configs)[源代码]
ultraopt.utils.config_space.initial_design_2(cs, n_configs, rng)[源代码]
ultraopt.utils.config_space.initial_design_cat(cs, n_configs)[源代码]
ultraopt.utils.config_space.is_top_level_activated(config_space, config, hp_name, hp_value=None)[源代码]
ultraopt.utils.config_space.sample_configuration_except_default(cs: ConfigSpace.configuration_space.ConfigurationSpace, idx2val: dict, is_child_list=None, sampled_vectors=None, rng=None)[源代码]
ultraopt.utils.config_space.sample_configurations(config_space, n_configs=1)[源代码]
ultraopt.utils.config_space.sample_vectors(cs, n_samples)[源代码]

ultraopt.utils.config_transformer module

class ultraopt.utils.config_transformer.ConfigTransformer(impute: Optional[float] = - 1, encoder=None)[源代码]

基类:object

fit(config_space: ConfigSpace.configuration_space.ConfigurationSpace)[源代码]
fit_encoder(vectors, losses=None)[源代码]
impute_conditional_data(array)[源代码]
inverse_transform(array: numpy.ndarray, return_vector=False) → Union[numpy.ndarray, None, ConfigSpace.configuration_space.Configuration][源代码]
transform(vectors: numpy.ndarray) → numpy.ndarray[源代码]

ultraopt.utils.hash module

ultraopt.utils.hash.get_hash_of_array(X, m=None)[源代码]
ultraopt.utils.hash.get_hash_of_config(config: Union[ConfigSpace.configuration_space.Configuration, Dict[str, Any]], m=None)[源代码]
ultraopt.utils.hash.get_hash_of_dict(dict_, m=None)[源代码]
ultraopt.utils.hash.sort_dict(obj)[源代码]

ultraopt.utils.logging_ module

class ultraopt.utils.logging_.PickableLoggerAdapter(name)[源代码]

基类:object

critical(msg, *args, **kwargs)[源代码]
debug(msg, *args, **kwargs)[源代码]
error(msg, *args, **kwargs)[源代码]
exception(msg, *args, **kwargs)[源代码]
info(msg, *args, **kwargs)[源代码]
isEnabledFor(level)[源代码]
log(level, msg, *args, **kwargs)[源代码]
warning(msg, *args, **kwargs)[源代码]
ultraopt.utils.logging_.get_logger(name)[源代码]
ultraopt.utils.logging_.setup_logger(output_file=None, logging_config=None)[源代码]

ultraopt.utils.loss_transformer module

class ultraopt.utils.loss_transformer.LogScaledLossTransformer[源代码]

基类:ultraopt.utils.loss_transformer.LossTransformer

fit_transform(y, *args)[源代码]
class ultraopt.utils.loss_transformer.LossTransformer[源代码]

基类:object

fit_transform(y, *args)[源代码]
class ultraopt.utils.loss_transformer.ScaledLossTransformer[源代码]

基类:ultraopt.utils.loss_transformer.LossTransformer

fit_transform(y, *args)[源代码]

ultraopt.utils.math_ module

ultraopt.utils.math_.float_gcd(a, b)[源代码]

ultraopt.utils.misc module

ultraopt.utils.misc.dump_checkpoint(optimizer, checkpoint_file)[源代码]
ultraopt.utils.misc.get_import_error(pkg_name)[源代码]
ultraopt.utils.misc.get_max_SH_iter(min_budget, max_budget, eta)[源代码]
ultraopt.utils.misc.pbudget(budget: float)[源代码]
ultraopt.utils.misc.print_incumbent_trajectory(chal_perf: float, inc_perf: float, challenger: dict, incumbent: dict, budget: float)[源代码]

ultraopt.utils.net module

ultraopt.utils.net.check_port_is_used(port, host='127.0.0.1') → bool[源代码]
ultraopt.utils.net.get_a_free_port(start_port, host='127.0.0.1') → int[源代码]

ultraopt.utils.progress module

Progress is reported using context managers.

A progress context manager takes an initial and a total argument and should yield an object with an update(n) method.

ultraopt.utils.progress.default_callback(initial, total)

Use tqdm for progress by default

ultraopt.utils.progress.no_progress_callback(initial, total)[源代码]
ultraopt.utils.progress.tqdm_progress_callback(initial, total)[源代码]

ultraopt.utils.std_out_err_redirect_tqdm module

Redirecting writing to tqdm (the progressbar).

See here: https://github.com/tqdm/tqdm#redirecting-writing

class ultraopt.utils.std_out_err_redirect_tqdm.DummyTqdmFile(file)[源代码]

基类:object

Dummy file-like that will write to tqdm.

close()[源代码]
file = None
flush()[源代码]
isatty()[源代码]
write(x)[源代码]
ultraopt.utils.std_out_err_redirect_tqdm.std_out_err_redirect_tqdm()[源代码]

Module contents