टेंसरफ़्लो :: ऑप्स :: संपादित करें
#include <array_ops.h>
गणना (संभवतः सामान्यीकृत) लेवेंसहाइट एडिट डिस्टेंस।
सारांश
इनपुट्स वैरिएंट-लेंथ सीक्वेंस हैं जो SparseTensors (हाइपोथीसिस_इंडिस, हाइपोथीसिस_वेल्यूज, हाइपोथीसिस_शैप) और (ट्रूथ_इंडिस, ट्रूथ_वेल्स, ट्रूथ_शैप) द्वारा दिए गए हैं।
इनपुट हैं:
तर्क:
- गुंजाइश: एक स्कोप ऑब्जेक्ट
- परिकल्पना_ सूचकांक: परिकल्पना सूची SparseTensor के सूचकांक। यह एक N x R int64 मैट्रिक्स है।
- हाइपोथिसिस_वेल्यूज: परिकल्पना सूची स्पार्सटेन्सर के मूल्य। यह एक एन-लेंथ वेक्टर है।
- परिकल्पना_शाप: परिकल्पना सूची SparseTensor का आकार। यह एक आर-लेंथ वेक्टर है।
- सत्य_ सूचकांक: सत्य सूची के सूचक स्पार्सटेन्सर। यह M x R int64 मैट्रिक्स है।
- true_values: सत्य सूची SparseTensor के मूल्य। यह एक एम-लेंथ वेक्टर है।
- true_shape: सत्य सूचकांक, वेक्टर।
वैकल्पिक विशेषताएँ ( Attrs
देखें):
- सामान्य करें: बूलियन (यदि सत्य है, तो सत्य की लंबाई से दूरी को सामान्य किया जाता है)।
आउटपुट है:
रिटर्न:
-
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
सार्वजनिक कार्य
संपादित करें
0a1a86dc0संपादित करें
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 )