tf.keras.losses.sparse_categorical_crossentropy

Computes the sparse categorical crossentropy loss.

Used in the notebooks

Used in the guide Used in the tutorials

Standalone usage:

y_true = [1, 2]
y_pred = [[0.05, 0.95, 0], [0.1, 0.8, 0.1]]
loss = tf.keras.losses.sparse_categorical_cros