keras/src/trainers/trainer.py/Trainer/metrics
class Trainer:    def metrics(self):
        metrics = [self._loss_tracker] if self.compiled else []
        metrics.extend(super().metrics)
        if self.compiled and self._compile_metrics is not None:
            metrics += [self._compile_metrics]
        return metrics