Skip to main content

early_stopping

Federated early stopping.

Classes

FederatedEarlyStopping

class FederatedEarlyStopping(metric: str, patience: int, delta: float):

Describes a criterion for early stopping of federated model training.

This is only applicable in the federated context where a Modeller is retrieving validation results from multiple workers over a training job and wants to signal to the workers to stop training if results are getting worse. Models already have their own local early stopping which is separate.

Arguments

  • metric: the metric whose value is checked every iteration. Must be one of the metrics that is calculated by the model
  • patience: number of iterations of worsening values before training is stopped
  • delta: how much the metric needs to improve by each iteration to count as an improvement

Variables

  • static delta : float
  • static metric : str
  • static patience : int

Methods


check

def check(self, results: List[Dict[str, float]])> bool:

Checks if early stopping criteria has been met.

Arguments

  • results: List of metrics

Returns True if the model training should stop training early, otherwise False.