tf.keras.metrics.sparse_categorical_accuracy

Calculates how often predictions matches integer labels.

Main aliases

tf.metrics.sparse_categorical_accuracy

Compat aliases for migration

See Migration guide for more details.

tf.compat.v1.keras.metrics.sparse_categorical_accuracy

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.