keras/src/metrics/regression_metrics.py/CosineSimilarity/__init__
class CosineSimilarity:    def __init__(self, name="cosine_similarity", dtype=None, axis=-1):
        super().__init__(cosine_similarity, name, dtype=dtype, axis=axis)
        # Metric should be maximized during optimization.
        self._direction = "up"