class_docstr: Monitor a metric and signal if execution should stop early.
  
  Args:
      mode: one of `min`, `max`. In `min` mode, signal to stop early will be given when
          the metric has stopped decreasing. In `max` mode, the signal is given when the
          metric has stopped increasing.
      patience: Number of checks without improvement after which early stop will be signaled.
      min_delta: Must be >= 0. Minimum absolute or relative change in the metric to qualify as
          an improvement. In `rel` mode, improvement_threshold = best_val * ( 1 + min_delta ) in 'max'
          mode or best_val * ( 1 - min_delta ) in `min` mode. In `abs` mode, improvement_threshold =
          best_val +  min_delta in `max` mode or best_val - threshold in `min` mode.
      check_finite: When set to `True`, signals early stop when metric becomes NaN or infinite.
      threshold_mode: one of `abs` or `rel`, threshold delta between checks for determining whether to stop.
      stopping_threshold: Signals early stop once the metric improves beyond this threshold.
      divergence_threshold: Signals early stop once the metric becomes worse than this threshold.
  
   Raises:
      ValueError:
          If `mode` is not `min` or `max`.
      ValueError:
          If `min_delta` < 0.
      ValueError:
          If `threshold_mode` is not `abs` or `rel`.
class_docstr_tok: ["Monitor","a","metric","and","signal","if","execution","should","stop","early",".","Args",":","mode",":","one","of","`","min","`",",","`","max","`",".","In","`","min","`","mode",",","signal","to","stop","early","will","be","given","when","the","metric","has","stopped","decreasing",".","In","`","max","`","mode",",","the","signal","is","given","when","the","metric","has","stopped","increasing",".","patience",":","Number","of","checks","without","improvement","after","which","early","stop","will","be","signaled",".","min_delta",":","Must","be",">","=","0",".","Minimum","absolute","or","relative","change","in","the","metric","to","qualify","as","an","improvement",".","In","`","rel","`","mode",",","improvement_threshold","=","best_val","*","(","1","+","min_delta",")","in","'max'","mode","or","best_val","*","(","1","-","min_delta",")","in","`","min","`","mode",".","In","`","abs","`","mode",",","improvement_threshold","=","best_val","+","min_delta","in","`","max","`","mode","or","best_val","-","threshold","in","`","min","`","mode",".","check_finite",":","When","set","to","`","True","`",",","signals","early","stop","when","metric","becomes","NaN","or","infinite",".","threshold_mode",":","one","of","`","abs","`","or","`","rel","`",",","threshold","delta","between","checks","for","determining","whether","to","stop",".","stopping_threshold",":","Signals","early","stop","once","the","metric","improves","beyond","this","threshold",".","divergence_threshold",":","Signals","early","stop","once","the","metric","becomes","worse","than","this","threshold",".","Raises",":","ValueError",":","If","`","mode","`","is","not","`","min","`","or","`","max","`",".","ValueError",":","If","`","min_delta","`","<","0",".","ValueError",":","If","`","threshold_mode","`","is","not","`","abs","`","or","`","rel","`","."]
docstr: The comparison character to use based on the mode.
docstr_tok: ["The","comparison","character","to","use","based","on","the","mode","."]
code: def _mode_char(
      self,
  ) -> Literal["<", ">"]:
      """The comparison character to use based on the mode."""
      return "<" if self.mode == "min" else ">"
  
imports: import logging
  from typing import Any, Callable, Dict, Optional, Union
  import torch
  from typing_extensions import final, Literal
label_desc: Use image node_id 14 for calling the EarlyStopChecker obj's underlying member method code with example usage: obj._mode_char() and returns: unknown