code: def state_dict(self) -> Dict[str, Any]:
          
          return {
                  "best_so_far": self._best_so_far,
                  "patience": self._patience,
                  "epochs_with_no_improvement": self._epochs_with_no_improvement,
                  "is_best_so_far": self._is_best_so_far,
                  "should_decrease": self._should_decrease,
                  "best_epoch_metrics": self.best_epoch_metrics,
                  "epoch_number": self._epoch_number,
                  "best_epoch": self.best_epoch
          }
docs: A ``Trainer`` can use this to serialize the state of the metric tracker.