    def add_metrics(self, metrics: Dict[str, float]) -> None:
        """
        Record a new value of the metric and update the various things that depend on it.
        """
        combined_score = self.combined_score(metrics)

        new_best = (self._best_so_far is None) or (combined_score > self._best_so_far)

        if new_best:
            self._best_so_far = combined_score
            self._epochs_with_no_improvement = 0
            self._is_best_so_far = True
            self.best_epoch = self._epoch_number
        else:
            self._epochs_with_no_improvement += 1
            self._is_best_so_far = False
        self._epoch_number += 1
Record a new value of the metric and update the various things that depend on it.
allennlp/training/metric_tracker.py