cotengra.hyperoptimizers.hyper_cmaes

Hyper parameter optimization using cmaes, as implemented by

https://github.com/CyberAgentAILab/cmaes.

Classes

HyperCMAESSampler

CMAESOptLib

Hyper-optimization using CMA-ES with per-method optimizers and

Module Contents

class cotengra.hyperoptimizers.hyper_cmaes.HyperCMAESSampler(space, sigma=1.0, lr_adapt=True, separable=False, exponential_param_power=None, **kwargs)[source]
params = []
opt
_trial_counter = 0
_trial_store
_batch = []
ask()[source]
tell(trial_number, value)[source]
class cotengra.hyperoptimizers.hyper_cmaes.CMAESOptLib[source]

Bases: cotengra.hyperoptimizers.hyper.HyperOptLib

Hyper-optimization using CMA-ES with per-method optimizers and a Lower Confidence Bound method selector.

setup(methods, space, optimizer=None, sigma=1.0, lr_adapt=True, method_exploration=1.0, method_temperature=1.0, exponential_param_power=None, **cmaes_opts)[source]

Initialize the optimizer state.

Parameters:
  • methods (list[str]) – The list of contraction methods to optimize over.

  • space (dict[str, dict[str, dict]]) – The search space for each method.

  • optimizer (HyperOptimizer, optional) – The parent HyperOptimizer instance, for accessing attributes like max_repeats.

  • kwargs – Extra options specific to the optimizer library.

get_setting()[source]

Suggest the next setting to trial.

Returns:

setting – Must contain at least {"method": str, "params": dict}. May also include tokens for reporting.

Return type:

dict

report_result(setting, trial, score)[source]

Report the result of a trial.

Parameters:
  • setting (dict) – The setting dict returned by get_setting.

  • trial (dict) – The trial result dict.

  • score (float) – The scalar score for this trial.