tensorflow:: عملیات:: ویرایش فاصله
#include <array_ops.h>فاصله ویرایش لونشتاین (احتمالاً نرمالشده) را محاسبه میکند.
خلاصه
ورودیها توالیهایی با طول متغیر هستند که توسط SparseTensors (شاخصهای فرضیه، مقادیر فرضیه، شکل فرضیه) و (شاخصهای حقیقت، مقادیر حقیقت، شکل حقیقت) ارائه میشوند.
ورودیها عبارتند از:
استدلالها:
- دامنه: یک شیء دامنه
- hypothesis_indices: اندیسهای لیست فرضیه SparseTensor. این یک ماتریس N x R از نوع int64 است.
- hypothesis_values: مقادیر لیست فرضیه SparseTensor. این یک بردار با طول N است.
- hypothesis_shape: شکل لیست فرضیه SparseTensor. این یک بردار با طول R است.
- truth_indices: اندیسهای لیست درستی SparseTensor. این یک ماتریس M x R از نوع int64 است.
- مقادیر حقیقی: مقادیر لیست حقیقی SparseTensor. این یک بردار با طول M است.
- truth_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) | |
ساختارها | |
|---|---|
| tensorflow:: عملیات:: 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
عملگر::tensorflow::ورودی
operator::tensorflow::Input() const
عملگر::tensorflow::خروجی
operator::tensorflow::Output() const
توابع استاتیک عمومی
عادیسازی
Attrs Normalize( bool x )
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2026-11-05 بهوقت ساعت هماهنگ جهانی.