Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::SoftmaxCrossEntropyWithLogits
#include <nn_ops.h>
Computes softmax cross entropy cost and gradients to backpropagate.
Summary
Inputs are the logits, not probabilities.
Args:
- scope: A Scope object
- features: batch_size x num_classes matrix
- labels: batch_size x num_classes matrix The caller must ensure that each batch of labels represents a valid probability distribution.
Returns:
Output
loss: Per example loss (batch_size vector).
Output
backprop: backpropagated gradients (batch_size x num_classes matrix).
Public attributes
Public functions
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 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tensorflow::ops::SoftmaxCrossEntropyWithLogits Class Reference\n\ntensorflow::ops::SoftmaxCrossEntropyWithLogits\n==============================================\n\n`#include \u003cnn_ops.h\u003e`\n\nComputes softmax cross entropy cost and gradients to backpropagate.\n\nSummary\n-------\n\nInputs are the logits, not probabilities.\n\nArgs:\n\n- scope: A [Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- features: batch_size x num_classes matrix\n- labels: batch_size x num_classes matrix The caller must ensure that each batch of labels represents a valid probability distribution.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) loss: Per example loss (batch_size vector).\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) backprop: backpropagated gradients (batch_size x num_classes matrix).\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SoftmaxCrossEntropyWithLogits](#classtensorflow_1_1ops_1_1_softmax_cross_entropy_with_logits_1a4cbff4fa9d4606e374b1a88b5de132dc)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` features, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` labels)` ||\n\n| ### Public attributes ||\n|---------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [backprop](#classtensorflow_1_1ops_1_1_softmax_cross_entropy_with_logits_1a3f3e88d3a28b38d7190c586e53a90391) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [loss](#classtensorflow_1_1ops_1_1_softmax_cross_entropy_with_logits_1ad3f6fea2fc731063932763fa4b3c8ce0) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_softmax_cross_entropy_with_logits_1aec7fdf4d82369e8bc00d0c9c8dd7faab) | [Operation](/versions/r2.14/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n\nPublic attributes\n-----------------\n\n### backprop\n\n```text\n::tensorflow::Output backprop\n``` \n\n### loss\n\n```text\n::tensorflow::Output loss\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\nPublic functions\n----------------\n\n### SoftmaxCrossEntropyWithLogits\n\n```gdscript\n SoftmaxCrossEntropyWithLogits(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input features,\n ::tensorflow::Input labels\n)\n```"]]