tensorflow:: אופס:: SparseSoftmaxCrossEntropyWithLogits
#include <nn_ops.h>
מחשבת עלות אנטרופיה צולבת של Softmax ושיפועים כדי להתפשט לאחור.
תַקצִיר
בניגוד SoftmaxCrossEntropyWithLogits
, פעולה זו אינה מקבלת מטריצה של הסתברויות תווית, אלא תווית בודדת לכל שורת תכונות. תווית זו נחשבת כבעלת הסתברות 1.0 עבור השורה הנתונה.
תשומות הן הלוגיטים, לא ההסתברויות.
טיעונים:
- scope: אובייקט Scope
- תכונות: batch_size x num_classes מטריצה
- תוויות: וקטור batch_size עם ערכים ב-[0, num_classes). זוהי התווית עבור ערך המיניאצ' הנתון.
החזרות:
- אובדן
Output
: לכל אובדן לדוגמה (וקטור batch_size). -
Output
אחורי: שיפועים מופצים לאחור (גודל_אצווה x מטריצת num_classes).
בנאים והורסים | |
---|---|
SparseSoftmaxCrossEntropyWithLogits (const :: tensorflow::Scope & scope, :: tensorflow::Input features, :: tensorflow::Input labels) |
תכונות ציבוריות | |
---|---|
backprop | |
loss | |
operation |
תכונות ציבוריות
משענת גב
::tensorflow::Output backprop
הֶפסֵד
::tensorflow::Output loss
מִבצָע
Operation operation
תפקידים ציבוריים
SparseSoftmaxCrossEntropyWithLogits
SparseSoftmaxCrossEntropyWithLogits( const ::tensorflow::Scope & scope, ::tensorflow::Input features, ::tensorflow::Input labels )
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-27 (שעון UTC)."],[],[],null,["# tensorflow::ops::SparseSoftmaxCrossEntropyWithLogits Class Reference\n\ntensorflow::ops::SparseSoftmaxCrossEntropyWithLogits\n====================================================\n\n`#include \u003cnn_ops.h\u003e`\n\nComputes softmax cross entropy cost and gradients to backpropagate.\n\nSummary\n-------\n\nUnlike [SoftmaxCrossEntropyWithLogits](/versions/r2.3/api_docs/cc/class/tensorflow/ops/softmax-cross-entropy-with-logits#classtensorflow_1_1ops_1_1_softmax_cross_entropy_with_logits), this operation does not accept a matrix of label probabilities, but rather a single label per row of features. This label is considered to have probability 1.0 for the given row.\n\nInputs are the logits, not probabilities.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- features: batch_size x num_classes matrix\n- labels: batch_size vector with values in \\[0, num_classes). This is the label for the given minibatch entry.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) loss: Per example loss (batch_size vector).\n- [Output](/versions/r2.3/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| [SparseSoftmaxCrossEntropyWithLogits](#classtensorflow_1_1ops_1_1_sparse_softmax_cross_entropy_with_logits_1a965e868e103e3908d2bfb1dcd368e90d)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` features, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` labels)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [backprop](#classtensorflow_1_1ops_1_1_sparse_softmax_cross_entropy_with_logits_1a9e77b4f5efe0d0762f8fc95a3f7cdbaa) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [loss](#classtensorflow_1_1ops_1_1_sparse_softmax_cross_entropy_with_logits_1aa3c9d1b704d919039c2cd2686fbea683) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_sparse_softmax_cross_entropy_with_logits_1ac581285ea4e5d57f85d8f317aed838fa) | [Operation](/versions/r2.3/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### SparseSoftmaxCrossEntropyWithLogits\n\n```gdscript\n SparseSoftmaxCrossEntropyWithLogits(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input features,\n ::tensorflow::Input labels\n)\n```"]]