tensorflow::ops::EditDistance
#include <array_ops.h>(Muhtemelen normalize edilmiş) Levenshtein Düzenleme Mesafesini hesaplar.
Özet
Girişler, SparseTensors tarafından sağlanan değişken uzunluktaki dizilerdir: (hipotez_indeksleri, hipotez_değerleri, hipotez_şekli) ve (gerçek_indeksleri, gerçek_değerleri, gerçek_şekli).
Girişler şunlardır:
Argümanlar:
- kapsam: Bir Kapsam nesnesi
- hypothesis_indices: Hipotez listesinin indekslerini içeren SparseTensor. Bu, N x R boyutunda bir int64 matrisidir.
- hypothesis_values: Hipotez listesinin değerlerini içeren SparseTensor. Bu, N uzunluğunda bir vektördür.
- hypothesis_shape: Hipotez listesinin SparseTensor'unun şekli. Bu, R uzunluğunda bir vektördür.
- truth_indices: Doğruluk listesinin SparseTensor'unun indeksleri. Bu, M x R boyutunda bir int64 matrisidir.
- truth_values: Doğruluk listesinin değerlerini içeren SparseTensor. Bu, M uzunluğunda bir vektördür.
- truth_shape: doğruluk indeksleri, vektör.
İsteğe bağlı özellikler (bkz. Attrs ):
- normalize: boolean (true ise, düzenleme mesafeleri gerçek uzunluğuna göre normalize edilir).
Çıktı şu şekildedir:
İadeler:
-
Output: Sıralaması R - 1 olan yoğun bir kayan noktalı tensör.
Örnek girdi için:
// 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
Çıktı şu şekilde olacaktır:
// 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
Yapıcılar ve Yıkıcılar | |
|---|---|
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) |
Genel özellikler | |
|---|---|
operation | |
output | |
Kamusal işlevler | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
Herkese açık statik fonksiyonlar | |
|---|---|
Normalize (bool x) | |
Yapılar | |
|---|---|
| tensorflow::ops::EditDistance::Attrs | EditDistance için isteğe bağlı özellik ayarlayıcıları. |
Genel özellikler
operasyon
Operation operation
çıktı
::tensorflow::Output output
Kamusal işlevler
Düzenleme Mesafesi
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 )
Düzenleme Mesafesi
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 )
düğüm
::tensorflow::Node * node() const
operatör::tensorflow::Giriş
operator::tensorflow::Input() const
operatör::tensorflow::Çıktı
operator::tensorflow::Output() const
Herkese açık statik fonksiyonlar
Normalleştir
Attrs Normalize( bool x )