संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: इनटॉपKV2
#include <nn_ops.h>
कहता है कि क्या लक्ष्य शीर्ष K
पूर्वानुमानों में हैं।
सारांश
यह एक batch_size
बूल ऐरे को आउटपुट करता है, एक प्रविष्टि out[i]
true
है यदि लक्ष्य वर्ग के लिए भविष्यवाणी सभी भविष्यवाणियों के बीच शीर्ष k
भविष्यवाणियों में से एक है, उदाहरण के लिए i
। ध्यान दें कि संबंधों के प्रबंधन में InTopK
का व्यवहार TopK
ऑप से भिन्न है; यदि कई वर्गों का पूर्वानुमान मान समान है और वे शीर्ष- k
सीमा तक फैले हुए हैं, तो उन सभी वर्गों को शीर्ष k
में माना जाता है।
अधिक औपचारिक रूप से, चलो
\(predictions_i\) i
के लिए सभी वर्गों के लिए भविष्यवाणियाँ करें, \(targets_i\) उदाहरण के लिए लक्ष्य वर्ग बनें i
, \(out_i\) उदाहरण के लिए आउटपुट बनें i
,
$$out_i = predictions_{i, targets_i} TopKIncludingTies(predictions_i)$$
तर्क:
- स्कोप: एक स्कोप ऑब्जेक्ट
- भविष्यवाणियाँ: एक
batch_size
x classes
टेंसर। - लक्ष्य: क्लास आईडी का एक
batch_size
वेक्टर। - k: कंप्यूटिंग परिशुद्धता के लिए देखने के लिए शीर्ष तत्वों की संख्या।
रिटर्न:
-
Output
: एक bool Tensor
के रूप में k
पर परिशुद्धता की गणना की गई।
सार्वजनिक गुण
सार्वजनिक समारोह
नोड
::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-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[],[],null,["# tensorflow::ops::InTopKV2 Class Reference\n\ntensorflow::ops::InTopKV2\n=========================\n\n`#include \u003cnn_ops.h\u003e`\n\nSays whether the targets are in the top `K` predictions.\n\nSummary\n-------\n\nThis outputs a `batch_size` bool array, an entry `out[i]` is `true` if the prediction for the target class is among the top `k` predictions among all predictions for example `i`. Note that the behavior of [InTopK](/versions/r1.15/api_docs/cc/class/tensorflow/ops/in-top-k#classtensorflow_1_1ops_1_1_in_top_k) differs from the [TopK](/versions/r1.15/api_docs/cc/class/tensorflow/ops/top-k#classtensorflow_1_1ops_1_1_top_k) op in its handling of ties; if multiple classes have the same prediction value and straddle the top-`k` boundary, all of those classes are considered to be in the top `k`.\n\nMore formally, let\n\n\\\\(predictions_i\\\\) be the predictions for all classes for example `i`, \\\\(targets_i\\\\) be the target class for example `i`, \\\\(out_i\\\\) be the output for example `i`,\n\n$$out_i = predictions_{i, targets_i} TopKIncludingTies(predictions_i)$$\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- predictions: A `batch_size` x `classes` tensor.\n- targets: A `batch_size` vector of class ids.\n- k: Number of top elements to look at for computing precision.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): Computed precision at `k` as a `bool `[Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor).\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [InTopKV2](#classtensorflow_1_1ops_1_1_in_top_k_v2_1a7c731af26675d2a0a5e65d4bf0501a07)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` predictions, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` targets, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` k)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_in_top_k_v2_1ad9127d0ee0e56405da77c8f8f0b0ad34) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [precision](#classtensorflow_1_1ops_1_1_in_top_k_v2_1a66a3668a94dcfe6ed4412c6d48fac92b) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_in_top_k_v2_1aca4c7a082803ec5e95dfcafac0999657)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_in_top_k_v2_1a7197986e89c2315b1a6458dcffdfd0d5)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_in_top_k_v2_1aa8a166a0b803daf34df7fd9ef3c91d40)`() const ` | ` ` ` ` |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### precision\n\n```text\n::tensorflow::Output precision\n``` \n\nPublic functions\n----------------\n\n### InTopKV2\n\n```gdscript\n InTopKV2(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input predictions,\n ::tensorflow::Input targets,\n ::tensorflow::Input k\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```"]]