keras/src/trainers/compile_utils.py/CompileMetrics/reset_state
class CompileMetrics:    def reset_state(self):
        if not self.built:
            return
        for m in self._flat_metrics:
            if m:
                m.reset_state()
        for m in self._flat_weighted_metrics:
            if m:
                m.reset_state()