Skip to content

OptunaSampler

Bases: SweepSampler[TBaseModel]

A sampler that uses Optuna for hyperparameter optimization.

Parameters:

  • trial (Trial) –

    The optuna trial to use for hyperparameter optimization.

__init__

__init__(trial: Trial) -> None

Initialize the OptunaSampler.

Parameters:

  • trial (Trial) –

    The optuna trial to use for hyperparameter optimization.

sample

sample(sweep: Sweeper[TBaseModel]) -> TBaseModel

Sample a model from the sweep.

Parameters:

  • sweep (TSweep) –

    The sweep to sample from.

Returns:

  • TBaseModel ( TBaseModel ) –

    The sampled model.