टेन्सरफ्लो::ऑप्स::एडिटडिस्टेंस
#include <array_ops.h>यह (संभवतः सामान्यीकृत) लेवेनस्टीन एडिट डिस्टेंस की गणना करता है।
सारांश
इनपुट, स्पार्सटेंसर (हाइपोथिसिस_इंडिक्स, हाइपोथिसिस_वैल्यूज़, हाइपोथिसिस_शेप) और (ट्रुथ_इंडिक्स, ट्रुथ_वैल्यूज़, ट्रुथ_शेप) द्वारा प्रदान किए गए चर-लंबाई वाले अनुक्रम हैं।
इनपुट इस प्रकार हैं:
तर्क:
- स्कोप: एक स्कोप ऑब्जेक्ट
- hypothesis_indices: परिकल्पना सूची SparseTensor के सूचकांक। यह एक N x R int64 मैट्रिक्स है।
- hypothesis_values: परिकल्पना सूची SparseTensor के मान। यह एक N-लंबाई वाला सदिश है।
- hypothesis_shape: परिकल्पना सूची SparseTensor का आकार। यह एक R-लंबाई वाला सदिश है।
- truth_indices: सत्य सूची SparseTensor के सूचकांक। यह एक M x R int64 मैट्रिक्स है।
- truth_values: सत्य सूची SparseTensor के मान। यह एक M-लंबाई वाला सदिश है।
- truth_shape: सत्य सूचकांक, सदिश।
वैकल्पिक विशेषताएँ (देखें Attrs ):
- normalize: बूलियन (यदि सत्य है, तो संपादन दूरियों को सत्य की लंबाई से सामान्यीकृत किया जाता है)।
आउटपुट यह है:
प्रतिफल:
-
Output: रैंक R - 1 वाला एक सघन फ्लोट टेंसर।
उदाहरण इनपुट के लिए:
// hypothesis represents a 2x1 matrix with variable-length values: // (0,0) = ["a"] // (1,0) = ["b"] hypothesis_indices = [[0, 0, 0], [1, 0, 0]] hypothesis_values = ["a", "b"] hypothesis_shape = [2, 1, 1] // truth represents a 2x2 matrix with variable-length values: // (0,0) = [] // (0,1) = ["a"] // (1,0) = ["b", "c"] // (1,1) = ["a"] truth_indices = [[0, 1, 0], [1, 0, 0], [1, 0, 1], [1, 1, 0]] truth_values = ["a", "b", "c", "a"] truth_shape = [2, 2, 2] normalize = true
आउटपुट इस प्रकार होगा:
// output is a 2x2 matrix with edit distances normalized by truth lengths. output = [[inf, 1.0], // (0,0): no truth, (0,1): no hypothesis [0.5, 1.0]] // (1,0): addition, (1,1): no hypothesis
कंस्ट्रक्टर और डिस्ट्रक्टर | |
|---|---|
EditDistance (const :: tensorflow::Scope & scope, :: tensorflow::Input hypothesis_indices, :: tensorflow::Input hypothesis_values, :: tensorflow::Input hypothesis_shape, :: tensorflow::Input truth_indices, :: tensorflow::Input truth_values, :: tensorflow::Input truth_shape) | |
EditDistance (const :: tensorflow::Scope & scope, :: tensorflow::Input hypothesis_indices, :: tensorflow::Input hypothesis_values, :: tensorflow::Input hypothesis_shape, :: tensorflow::Input truth_indices, :: tensorflow::Input truth_values, :: tensorflow::Input truth_shape, const EditDistance::Attrs & attrs) |
सार्वजनिक विशेषताएँ | |
|---|---|
operation | |
output | |
सार्वजनिक समारोह | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
सार्वजनिक स्थैतिक फ़ंक्शन | |
|---|---|
Normalize (bool x) | |
संरचनाएँ | |
|---|---|
| टेन्सरफ्लो::ऑप्स::एडिटडिस्टेंस::एट्रिब्यूट्स | EditDistance के लिए वैकल्पिक विशेषता निर्धारक। |
सार्वजनिक विशेषताएँ
संचालन
Operation operation
आउटपुट
::tensorflow::Output output
सार्वजनिक समारोह
संपादन दूरी
EditDistance( const ::tensorflow::Scope & scope, ::tensorflow::Input hypothesis_indices, ::tensorflow::Input hypothesis_values, ::tensorflow::Input hypothesis_shape, ::tensorflow::Input truth_indices, ::tensorflow::Input truth_values, ::tensorflow::Input truth_shape )
संपादन दूरी
EditDistance( const ::tensorflow::Scope & scope, ::tensorflow::Input hypothesis_indices, ::tensorflow::Input hypothesis_values, ::tensorflow::Input hypothesis_shape, ::tensorflow::Input truth_indices, ::tensorflow::Input truth_values, ::tensorflow::Input truth_shape, const EditDistance::Attrs & attrs )
नोड
::tensorflow::Node * node() const
ऑपरेटर::टेन्सरफ्लो::इनपुट
operator::tensorflow::Input() const
ऑपरेटर::टेन्सरफ्लो::आउटपुट
operator::tensorflow::Output() const
सार्वजनिक स्थैतिक फ़ंक्शन
सामान्य
Attrs Normalize( bool x )