tf.raw_ops.SoftmaxCrossEntropyWithLogits
Computes softmax cross entropy cost and gradients to backpropagate.
tf.raw_ops.SoftmaxCrossEntropyWithLogits(
features, labels, name=None
)
Inputs are the logits, not probabilities.
Args |
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).
|
Returns |
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 .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-01-23 UTC.
[null,null,["Last updated 2024-01-23 UTC."],[],[]]