cotengra.hyperoptimizers.hyper_optuna ===================================== .. py:module:: cotengra.hyperoptimizers.hyper_optuna .. autoapi-nested-parse:: Hyper optimization using optuna. Classes ------- .. autoapisummary:: cotengra.hyperoptimizers.hyper_optuna.OptunaOptLib Functions --------- .. autoapisummary:: cotengra.hyperoptimizers.hyper_optuna.make_getter cotengra.hyperoptimizers.hyper_optuna.make_retriever Module Contents --------------- .. py:function:: make_getter(name, param) .. py:function:: make_retriever(methods, space) .. py:class:: OptunaOptLib Bases: :py:obj:`cotengra.hyperoptimizers.hyper.HyperOptLib` Hyper-optimization using ``optuna``. .. py:method:: setup(methods, space, optimizer=None, sampler='TPESampler', sampler_opts=None, **create_study_opts) Initialize the optimizer state. :param methods: The list of contraction methods to optimize over. :type methods: list[str] :param space: The search space for each method. :type space: dict[str, dict[str, dict]] :param optimizer: The parent ``HyperOptimizer`` instance, for accessing attributes like ``max_repeats``. :type optimizer: HyperOptimizer, optional :param kwargs: Extra options specific to the optimizer library. .. py:method:: get_setting() Suggest the next setting to trial. :returns: **setting** -- Must contain at least ``{"method": str, "params": dict}``. May also include tokens for reporting. :rtype: dict .. py:method:: report_result(setting, trial, score) Report the result of a trial. :param setting: The setting dict returned by ``get_setting``. :type setting: dict :param trial: The trial result dict. :type trial: dict :param score: The scalar score for this trial. :type score: float