tf.keras.metrics.sparse_categorical_accuracy

TensorFlow 1 version View source on GitHub

Calculates how often predictions matches integer labels.

You can provide logits of classes as y_pred, since argmax of logits and probabilities are same.

y_true Integer ground truth values.
y_pred The prediction values.

Sparse categorical accuracy values.