optuna.integration.SkorchPruningCallback

class optuna.integration.SkorchPruningCallback(trial: optuna.trial._trial.Trial, monitor: str)[source]

Skorch callback to prune unpromising trials.

New in version 2.1.0.

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

  • monitor – An evaluation metric for pruning, e.g. val_loss or val_acc. The metrics are obtained from the returned dictionaries, i.e., net.histroy. The names thus depend on how this dictionary is formatted.

__init__(trial: optuna.trial._trial.Trial, monitor: str)None[source]

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

Methods

__init__(trial, monitor)

Initialize self.

on_epoch_end(net, **kwargs)