multi_training_pruner
Prunes a trial when one of the trainings returns infinite band energy.
- class MultiTrainingPruner(*args: Any, **kwargs: Any)[source]
Bases:
BasePruner
Implements the NASWOT method (first version of paper) as an optuna pruner.
This means that before each training of a trial network the network will be tested against a user defined surrogate score (which has to be calibrated). If this score is good enough, the candidate will be trained.
- Parameters:
search_parameters (mala.common.parametes.Parameters) – Parameters used to create this objective.
- prune(study: optuna.study.Study, trial: optuna.trial.FrozenTrial) bool [source]
Judge whether the trial should be pruned based on the reported values.
In this case, it is checked whether one of the multiple trainings reported an infinte loss (especially viable for the band_energy metric).
- Parameters:
study (optuna.study.Study) – Study object of the target study.
trial (optuna.trial.FrozenTrial) – FrozenTrial object of the target trial. Take a copy before modifying this object.
- Returns:
should_prune – A boolean indicating whether this particular trial should be pruned.
- Return type:
bool