class_docstr: Simple patience tracker.
  
  Given an `Objective`, it will check whether the metric has improved and
  update its patience count. A better value sets the patience back to zero.
  
  In addition, one needs to call ``reset()`` explicitly after the patience
  was exceeded, otherwise `RuntimError` is raised when trying to invoke
  `step`.
  
  ``Patience`` keeps track of the number of invocations to ``reset``, via
  ``num_resets``.
code: def step(self, metric_value: float) -> bool:
      if self.exceeded:
          raise RuntimeError("Patience already exceeded.")
  
      has_improved = self.objective.update(metric_value)
  
      if has_improved:
          self.current_patience = 0
      else:
          self.current_patience += 1
  
      # this can also trigger in case of improvement when `self.patience = 0`
      self.exceeded = self.current_patience >= self.patience
      return self.exceeded
  
imports: from dataclasses import field
  from typing import Dict, Any, Optional
  from typing_extensions import Literal
  import numpy
  import mxnet
  from mxnet import gluon
  import mxnet.gluon.nn
  from gluonts.core.component import validated
  from gluonts.pydantic import dataclass
  from .callback import Callback
label_desc: Use image node_id 2 for calling the Patience obj's underlying member method code with example usage: obj.step(metric_value) and returns: self