optuna.integration.TensorFlowPruningHook

class optuna.integration.TensorFlowPruningHook(trial: optuna.trial._trial.Trial, estimator: tf.estimator.Estimator, metric: str, run_every_steps: int)[source]

TensorFlow SessionRunHook to prune unpromising trials.

See the example if you want to add a pruning hook to TensorFlow’s estimator.

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

  • estimator – An estimator which you will use.

  • metric – An evaluation metric for pruning, e.g., accuracy and loss.

  • run_every_steps – An interval to watch the summary file.

__init__(trial: optuna.trial._trial.Trial, estimator: tf.estimator.Estimator, metric: str, run_every_steps: int)None[source]

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

Methods

__init__(trial, estimator, metric, …)

Initialize self.

after_run(run_context, run_values)

before_run(run_context)

begin()