cotengra.hyperoptimizers.hyper_skopt

Hyper optimization using scikit-optimize.

Classes

SkoptOptLib

Hyper-optimization using scikit-optimize.

Functions

convert_param_to_skopt(param, name)

get_methods_space(methods)

convert_to_skopt_space(method, space)

Module Contents

cotengra.hyperoptimizers.hyper_skopt.convert_param_to_skopt(param, name)[source]
cotengra.hyperoptimizers.hyper_skopt.get_methods_space(methods)[source]
cotengra.hyperoptimizers.hyper_skopt.convert_to_skopt_space(method, space)[source]
class cotengra.hyperoptimizers.hyper_skopt.SkoptOptLib[source]

Bases: cotengra.hyperoptimizers.hyper.HyperOptLib

Hyper-optimization using scikit-optimize.

setup(methods, space, optimizer=None, sampler='et', method_sampler='et', sampler_opts=None, method_sampler_opts=None, **kwargs)[source]

Initialize the scikit-optimize optimizer.

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

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

  • optimizer (HyperOptimizer, optional) – The parent optimizer instance.

  • sampler (str, optional) –

    The regressor to use to optimize each method’s search space, valid options are:

    • ”et”: Extra Trees Regressor

    • ”rf”: Random Forest Regressor

    • ”gbrt”: Gradient Boosting Regressor

    • ”gp”: Gaussian Process Regressor

  • method_sampler (str, optional) – Meta-optimizer to use to select which overall method to use.

  • sampler_opts (dict, optional) – Options to supply to the per-method optimizer.

  • method_sampler_opts (dict, optional) – Options to supply to the method selector.

get_setting()[source]

Find the next parameters to test.

report_result(setting, trial, score)[source]

Report the result of a trial to the skopt optimizers.