W3cubDocs

/TensorFlow Python

tf.keras.backend.categorical_crossentropy

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

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

Categorical crossentropy between an output tensor and a target tensor.

Arguments:

  • target: A tensor of the same shape as output.
  • 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.

© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/keras/backend/categorical_crossentropy