optuna.integration.PyTorchIgnitePruningHandler

class optuna.integration.PyTorchIgnitePruningHandler(trial: optuna.trial._trial.Trial, metric: str, trainer: Engine)[source]

PyTorch Ignite handler to prune unpromising trials.

See the example if you want to add a pruning handler which observes validation accuracy.

Parameters
  • trial – A Trial corresponding to the current evaluation of the objective function.

  • metric – A name of metric for pruning, e.g., accuracy and loss.

  • trainer – A trainer engine of PyTorch Ignite. Please refer to ignite.engine.Engine reference for further details.

__init__(trial: optuna.trial._trial.Trial, metric: str, trainer: Engine)None[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(trial, metric, trainer)

Initialize self.