จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: SparseSoftmaxCrossEntropyWithLogits
#include <nn_ops.h>
คำนวณต้นทุนเอนโทรปีข้าม softmax และการไล่ระดับสีเพื่อเผยแพร่กลับ
สรุป
ต่างจาก SoftmaxCrossEntropyWithLogits
ตรงที่การดำเนินการนี้ไม่ยอมรับเมทริกซ์ของความน่าจะเป็นของเลเบล แต่เป็นเลเบลเดียวต่อแถวของคุณลักษณะ ป้ายกำกับนี้ถือว่ามีความน่าจะเป็น 1.0 สำหรับแถวที่กำหนด
อินพุตคือบันทึก ไม่ใช่ความน่าจะเป็น
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- คุณสมบัติ: เมทริกซ์ชุดขนาด x num_classes
- ป้ายกำกับ: เวกเตอร์ขนาดแบตช์ที่มีค่าเป็น [0, num_classes) นี่คือป้ายกำกับสำหรับรายการมินิแบทช์ที่กำหนด
ผลตอบแทน:
- การสูญเสีย
Output
: ตามตัวอย่างการสูญเสีย (เวกเตอร์ขนาดแบทช์) - backprop
Output
: การไล่ระดับสีแบบแบ็คโพรเพน (batch_size x num_classes matrix)
คุณลักษณะสาธารณะ
งานสาธารณะ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 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.1/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.1/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.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) loss: Per example loss (batch_size vector).\n- [Output](/versions/r2.1/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.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` features, ::`[tensorflow::Input](/versions/r2.1/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.1/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.1/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.1/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```"]]