TensorFlow · Class
losses.SparseCategoricalCrossentropy
Computes crossentropy for classification labels stored as integer class IDs. Use it when predictions contain one value per class and labels are not one-hot encoded.
Last updated
Syntax
tf.keras.losses.SparseCategoricalCrossentropy(from_logits=False, ignore_class=None, reduction="sum_over_batch_size", axis=-1, name="sparse_categorical_crossentropy", dtype=None)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
tf.keras.losses.CategoricalCrossentropytf.keras.losses.Loss