Exceptions¶
-
class
optuna.exceptions.
TrialPruned
[source]¶ Exception for pruned trials.
This error tells a trainer that the current
Trial
was pruned. It is supposed to be raised afteroptuna.trial.Trial.should_prune()
as shown in the following example.Example
>>> def objective(trial): >>> ... >>> for step in range(n_train_iter): >>> ... >>> if trial.should_prune(): >>> raise TrailPruned()
-
class
optuna.exceptions.
CLIUsageError
[source]¶ Exception for CLI.
CLI raises this exception when it receives invalid configuration.