keras/src/metrics/accuracy_metrics.py/TopKCategoricalAccuracy/__init__
class TopKCategoricalAccuracy:    def __init__(self, k=5, name="top_k_categorical_accuracy", dtype=None):
        super().__init__(
            fn=top_k_categorical_accuracy,
            name=name,
            dtype=dtype,
            k=k,
        )
        self.k = k
        # Metric should be maximized during optimization.
        self._direction = "up"