संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: स्पार्ससॉफ्टमैक्स
#include <sparse_ops.h>
बैचेड ND SparseTensor
पर सॉफ्टमैक्स लागू करता है।
सारांश
इनपुट तार्किक आकार [..., B, C]
(जहां N >= 2
) के साथ एक एनडी स्पार्सटेन्सर का प्रतिनिधित्व करते हैं, और कैनोनिकल लेक्सिकोग्राफ़िक क्रम में क्रमबद्ध सूचकांकों के साथ।
यह ऑपशन [B, C]
आकार वाले प्रत्येक आंतरिक तार्किक सबमैट्रिक्स पर सामान्य tf.nn.softmax()
लागू करने के बराबर है, लेकिन इस शर्त के साथ कि अंतर्निहित शून्य तत्व भाग नहीं लेते हैं । विशेष रूप से, एल्गोरिथ्म निम्नलिखित के बराबर है:
(1) आकार-सी आयाम के साथ आकार [B, C]
के साथ प्रत्येक अंतरतम सबमैट्रिक्स के सघन दृश्य पर tf.nn.softmax()
लागू करता है; (2) मूल अंतर्निहित-शून्य स्थानों को छिपा देता है; (3) शेष तत्वों को पुनः सामान्यीकृत करता है।
इसलिए, SparseTensor
परिणाम में बिल्कुल समान गैर-शून्य सूचकांक और आकार हैं।
तर्क:
- स्कोप: एक स्कोप ऑब्जेक्ट
- sp_indices: 2-डी.
NNZ x R
मैट्रिक्स, विहित क्रम में, SparseTensor में गैर-रिक्त मानों के सूचकांक के साथ। - sp_मान: 1-डी.
sp_indices
के अनुरूप NNZ
गैर-रिक्त मान। - एसपी_आकार: 1-डी. इनपुट SparseTensor का आकार।
रिटर्न:
-
Output
: 1-डी. SparseTensor
परिणाम के लिए NNZ
मान।
सार्वजनिक गुण
सार्वजनिक समारोह
नोड
::tensorflow::Node * node() const
operator::tensorflow::Input() const
ऑपरेटर::टेन्सरफ़्लो::आउटपुट
operator::tensorflow::Output() const
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया."],[],[],null,["# tensorflow::ops::SparseSoftmax Class Reference\n\ntensorflow::ops::SparseSoftmax\n==============================\n\n`#include \u003csparse_ops.h\u003e`\n\nApplies softmax to a batched N-D `SparseTensor`.\n\nSummary\n-------\n\nThe inputs represent an N-D SparseTensor with logical shape `[..., B, C]` (where `N \u003e= 2`), and with indices sorted in the canonical lexicographic order.\n\nThis op is equivalent to applying the normal `tf.nn.softmax()` to each innermost logical submatrix with shape `[B, C]`, but with the catch that *the implicitly zero elements do not participate*. Specifically, the algorithm is equivalent to the following:\n\n(1) Applies `tf.nn.softmax()` to a densified view of each innermost submatrix with shape `[B, C]`, along the size-C dimension; (2) Masks out the original implicitly-zero locations; (3) Renormalizes the remaining elements.\n\nHence, the `SparseTensor` result has exactly the same non-zero indices and shape.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- sp_indices: 2-D. `NNZ x R` matrix with the indices of non-empty values in a SparseTensor, in canonical ordering.\n- sp_values: 1-D. `NNZ` non-empty values corresponding to `sp_indices`.\n- sp_shape: 1-D. Shape of the input SparseTensor.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): 1-D. The `NNZ` values for the result `SparseTensor`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SparseSoftmax](#classtensorflow_1_1ops_1_1_sparse_softmax_1a64ec9c22eb2f8d50797cfb39eb94009d)`(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)` sp_indices, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sp_values, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sp_shape)` ||\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_sparse_softmax_1ad2dc43b15de20c26df875d2e2f5e9191) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_sparse_softmax_1a94b1fda8269b6888396b9c165fdd28b1) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|--------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_sparse_softmax_1aabb6b649a7d5f3c8a9db2dea2c44ef1a)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_softmax_1af6f0269e4c290ac6b8234ba881dafe13)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_softmax_1a1fccadd0a530764ea2d1691045ebf2a5)`() const ` | ` ` ` ` |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### SparseSoftmax\n\n```gdscript\n SparseSoftmax(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input sp_indices,\n ::tensorflow::Input sp_values,\n ::tensorflow::Input sp_shape\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n```"]]