টেনসরফ্লো :: অপস:: দূরত্ব সম্পাদনা করুন
#include <array_ops.h>
Levenshtein সম্পাদনা দূরত্ব (সম্ভবত স্বাভাবিক করা) গণনা করে।
সারাংশ
ইনপুটগুলি হল স্পারসটেনসর (অনুমান_সূচক, অনুমান_মূল্য, অনুমান_আকৃতি) এবং (সত্য_সূচক, সত্য_মান, সত্য_আকৃতি) দ্বারা প্রদত্ত পরিবর্তনশীল-দৈর্ঘ্যের ক্রম।
ইনপুটগুলি হল:
যুক্তি:
- স্কোপ: একটি স্কোপ অবজেক্ট
- hypothesis_indices: অনুমানের তালিকা স্পারসটেনসরের সূচক। এটি একটি N x R int64 ম্যাট্রিক্স।
- hypothesis_values: হাইপোথিসিস তালিকার মান SparseTensor. এটি একটি N-দৈর্ঘ্য ভেক্টর।
- hypothesis_shape: অনুমানের তালিকা স্পারসটেনসরের আকৃতি। এটি একটি R-দৈর্ঘ্য ভেক্টর।
- truth_indices: সত্য তালিকার সূচক SparseTensor. এটি একটি M x R int64 ম্যাট্রিক্স।
- truth_values: সত্যতালিকার SparseTensor এর মান। এটি একটি M-দৈর্ঘ্য ভেক্টর।
- সত্য_আকৃতি: সত্য সূচক, ভেক্টর।
ঐচ্ছিক বৈশিষ্ট্য (দেখুন 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) |
পাবলিক ফাংশন | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
কাঠামো | |
---|---|
tensorflow:: ops:: EditDistance:: Attrs | 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
)