noether.core.callbacks.early_stoppers.base

Exceptions

EarlyStopIteration

Custom StopIteration exception for Early Stoppers.

Classes

EarlyStopperBase

Base class for early stoppers that is used to define the interface for early stoppers used by the trainers.

Module Contents

exception noether.core.callbacks.early_stoppers.base.EarlyStopIteration

Bases: StopIteration

Custom StopIteration exception for Early Stoppers.

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

class noether.core.callbacks.early_stoppers.base.EarlyStopperBase(callback_config, trainer, model, data_container, tracker, log_writer, checkpoint_writer, metric_property_provider, name=None)

Bases: noether.core.callbacks.periodic.PeriodicCallback

Base class for early stoppers that is used to define the interface for early stoppers used by the trainers.

Parameters:
to_short_interval_string()

Convert the interval to a short string representation used for logging.

Return type:

str

periodic_callback(*, interval_type, update_counter, **kwargs)

Check if training should stop and raise exception if needed.

Parameters:
  • interval_type (noether.core.callbacks.periodic.IntervalType) – Type of interval that triggered this callback.

  • update_counter (noether.core.utils.training.UpdateCounter) – UpdateCounter instance with current training state.

  • **kwargs – Additional keyword arguments.

Raises:

EarlyStopIteration – If training should be stopped based on the stopping criterion.

Return type:

None