    def state_dict(self) -> Dict[str, Any]:
        """
        A `Trainer` can use this to serialize the state of the metric tracker.
        """
        return {
            "best_so_far": self._best_so_far,
            "epochs_with_no_improvement": self._epochs_with_no_improvement,
            "is_best_so_far": self._is_best_so_far,
            "epoch_number": self._epoch_number,
            "best_epoch": self.best_epoch,
            "best_epoch_metrics": self.best_epoch_metrics,
        }
A `Trainer` can use this to serialize the state of the metric tracker.
allennlp/training/metric_tracker.py