optuna.integration.TFKerasPruningCallback

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

tf.keras callback to prune unpromising trials.

This callback is intend to be compatible for TensorFlow v1 and v2, but only tested with TensorFlow v1.

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

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.

__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(epoch[, logs])