addons.tune.optuna
Handles the optuna backend
#
OptunaTunerStatus Objectsclass OptunaTunerStatus(TypedDict)
Tuner status return object for Optuna -- supports the define-and-run style interface from Optuna
Attributes:
trial
- current ask trial samplestudy
- current optuna study object
#
OptunaInterface Objectsclass OptunaInterface(BaseInterface)
Specific override to support the optuna backend -- supports the define-and-run style interface from Optuna
Attributes:
_map_type
- dictionary that maps class names and types to fns that create optuna distributions_trial
- current trial object from the optuna backend_tuner_obj
- underlying optuna study object_tuner_namespace
- tuner namespace that has attr classes that maps to an underlying library types_param_obj
- underlying object that optuna study can sample from (flat dictionary)_sample_hash
- hash of the most recent sample draw
#
__init__def __init__(tuner_config: OptunaTunerConfig, tuner_namespace)
OptunaInterface init call that maps variables, creates a map to fnc calls, and constructs the necessary underlying objects
Arguments:
tuner_config
- configuration object for the optuna backendtuner_namespace
- tuner namespace that has attr classes that maps to an underlying library types
#
_uniform_float_distdef _uniform_float_dist(val)
Assemble the optuna.distributions.(Log)UniformDistribution object
https://optuna.readthedocs.io/en/stable/reference/generated/optuna.distributions.UniformDistribution.html https://optuna.readthedocs.io/en/stable/reference/generated/optuna.distributions.LogUniformDistribution.html
Arguments:
val
- current attr val
Returns:
optuna.distributions.UniformDistribution or optuna.distributions.LogUniformDistribution
#
_uniform_int_distdef _uniform_int_dist(val)
Assemble the optuna.distributions.Int(Log)UniformDistribution object
https://optuna.readthedocs.io/en/stable/reference/generated/optuna.distributions.IntUniformDistribution.html https://optuna.readthedocs.io/en/stable/reference/generated/optuna.distributions.IntLogUniformDistribution.html
Arguments:
val
- current attr val
Returns:
optuna.distributions.IntUniformDistribution or optuna.distributions.IntLogUniformDistribution
#
_categorical_distdef _categorical_dist(val)
Assemble the optuna.distributions.CategoricalDistribution object
Arguments:
val
- current attr val
Returns:
optuna.distributions.CategoricalDistribution