/TensorFlow 2.4


Computes softmax cross entropy cost and gradients to backpropagate.

Inputs are the logits, not probabilities.

features A Tensor. Must be one of the following types: half, bfloat16, float32, float64. batch_size x num_classes matrix
labels A Tensor. Must have the same type as features. batch_size x num_classes matrix The caller must ensure that each batch of labels represents a valid probability distribution.
name A name for the operation (optional).
A tuple of Tensor objects (loss, backprop).
loss A Tensor. Has the same type as features.
backprop A Tensor. Has the same type as features.

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.