tf.keras.backend.sparse_categorical_crossentropy

tf.keras.backend.sparse_categorical_crossentropy(
    target,
    output,
    from_logits=False
)

Defined in tensorflow/python/keras/backend.py.

Categorical crossentropy with integer targets.

Arguments:

  • target: An integer tensor.
  • output: A tensor resulting from a softmax (unless from_logits is True, in which case output is expected to be the logits).
  • from_logits: Boolean, whether output is the result of a softmax, or is a tensor of logits.

Returns:

Output tensor.