docstr: Callable class to keep track of early stopping.
  
  Args:
      tolerance(int): number of validation steps without improving
      scorer(fn): list of scorers to validate performance on dev
docstr_tok: ["Callable","class","to","keep","track","of","early","stopping",".","Args",":","tolerance","(","int",")",":","number","of","validation","steps","without","improving","scorer","(","fn",")",":","list","of","scorers","to","validate","performance","on","dev"]
code: def __init__(self, tolerance, scorers=DEFAULT_SCORERS):
      """
      Callable class to keep track of early stopping.
  
      Args:
          tolerance(int): number of validation steps without improving
          scorer(fn): list of scorers to validate performance on dev
      """
  
      self.tolerance = tolerance
      self.stalled_tolerance = self.tolerance
      self.current_tolerance = self.tolerance
      self.early_stopping_scorers = scorers
      self.status = PatienceEnum.IMPROVING
      self.current_step_best = 0
  
imports: from enum import Enum
  from onmt.utils.logging import logger
label_desc: Use image node_id 1 to create a new EarlyStopping object from inherited base classes: object with example: obj = EarlyStopping(tolerance, scorers)