optuna_integration.TFKerasPruningCallback
- class optuna_integration.TFKerasPruningCallback(trial, monitor)[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 v2.
See the example if you want to add a pruning callback which observes the validation accuracy.
- Parameters:
trial (optuna.trial.Trial) – A
Trial
corresponding to the current evaluation of the objective function.monitor (str) – An evaluation metric for pruning, e.g.,
val_loss
orval_acc
.
Methods
on_epoch_end
(epoch[, logs])