class_docstr: A default early stopping implementation which supports stopping based on thresholds
  or based on patience-based improvement.
  
  .. versionadded:: 1.1.0
class_docstr_tok: ["A","default","early","stopping","implementation","which","supports","stopping","based","on","thresholds","or","based","on","patience-based","improvement",".","..","versionadded",":",":","1.1.0"]
docstr: Checks if the training should be stopped early. The decision is made based on
  the masured values of one or more quantitative metrics over time.
  
  1. Returns `True` if the threshold is crossed/undercut (for accuracy/loss respectively).
  2. Checks for an improvement and returns `True` if patience has been execeeded.
  3. Otherwise, return `False`.
  
  Parameters
  ----------
  epoch : int
      The number of the current epoch (1-indexed). Multiple checks per epoch are allowed.
  measured_values : dict of str to float
      A dictionary of measured values.
docstr_tok: ["Checks","if","the","training","should","be","stopped","early",".","The","decision","is","made","based","on","the","masured","values","of","one","or","more","quantitative","metrics","over","time",".","1",".","Returns","`","True","`","if","the","threshold","is","crossed\/undercut","(","for","accuracy\/loss","respectively",")",".","2",".","Checks","for","an","improvement","and","returns","`","True","`","if","patience","has","been","execeeded",".","3",".","Otherwise",",","return","`","False","`",".","Parameters","--","--","--","--","--","epoch",":","int","The","number","of","the","current","epoch","(","1-indexed",")",".","Multiple","checks","per","epoch","are","allowed",".","measured_values",":","dict","of","str","to","float","A","dictionary","of","measured","values","."]
code: def check_early_stop(self, epoch, measured_values):
      """Checks if the training should be stopped early. The decision is made based on
      the masured values of one or more quantitative metrics over time.
  
      1. Returns `True` if the threshold is crossed/undercut (for accuracy/loss respectively).
      2. Checks for an improvement and returns `True` if patience has been execeeded.
      3. Otherwise, return `False`.
  
      Parameters
      ----------
      epoch : int
          The number of the current epoch (1-indexed). Multiple checks per epoch are allowed.
      measured_values : dict of str to float
          A dictionary of measured values.
      """
      if epoch <= 0:
          raise ValueError(
              'Argument "epoch" must be greater than zero.'
          )
  
      self._history = self.add_to_history(epoch, measured_values)
  
      metric_sign = -1 if self.metric.lower_is_better else 1
  
      measured_value = measured_values.get(self.metric.name, None)
      has_crossed_threshold = (
          measured_value is not None
          and np.sign(measured_value - self.threshold) == metric_sign
      )
      if self.threshold > 0 and has_crossed_threshold:
          logging.debug(
              f"Early stopping: Threshold exceeded. "
              f"[value={measured_values[self.metric.name]}, "
              f"threshold={self.threshold}]"
          )
          return True
      elif measured_value is None:
          return False
  
      if len(self._history) == 1:
          self._index_best = 0
          return False
  
      if self.patience < 0:
          return False
      else:
          return self._check_for_improvement(
              measured_values, metric_sign
          )
  
imports: import logging
  import numpy
  from abc import ABC
label_desc: Use image node_id 3 for calling the EarlyStopping obj's underlying member method code with example usage: obj.check_early_stop(epoch, measured_values) and returns: True, False, False, self, False