tensor akışı:: işlem:: Mesafeyi Düzenle

#include <array_ops.h>

(Muhtemelen normalleştirilmiş) Levenshtein Düzenleme Mesafesini hesaplar.

Özet

Girdiler, SparseTensors (hipotez_indisleri, hipotez_değerleri, hipotez_şekli) ve (doğruluk_indisleri, doğruluk_değerleri, doğruluk_şekli) tarafından sağlanan değişken uzunluklu dizilerdir.

Girişler şunlardır:

Argümanlar:

  • kapsam: Bir Kapsam nesnesi
  • hipotez_indices: SparseTensor hipotez listesinin endeksleri. Bu bir N x R int64 matrisidir.
  • hipotez_değerleri: SparseTensor hipotez listesinin değerleri. Bu N uzunlukta bir vektördür.
  • hipotez_shape: SparseTensor hipotez listesinin şekli. Bu bir R-uzunluk vektörüdür.
  • Truth_indices: SparseTensor doğruluk listesinin endeksleri. Bu bir M x R int64 matrisidir.
  • doğruluk_değerleri: SparseTensor doğruluk listesinin değerleri. Bu M uzunlukta bir vektördür.
  • Truth_shape: doğruluk endeksleri, vektör.

İsteğe bağlı özellikler (bkz. Attrs ):

  • normalleştirme: boolean (eğer doğruysa, düzenleme mesafeleri gerçeğin uzunluğuna göre normalleştirilir).

Çıktı:

İadeler:

  • Output : Derecesi R - 1 olan yoğun bir kayan nokta tensörü.

Örnek giriş 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ı şöyle 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

Kamu işlevleri

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

Genel statik işlevler

Normalize (bool x)

Yapılar

tensorflow:: ops:: DüzenlemeMesafesi:: Öznitelikler

EditDistance için isteğe bağlı özellik ayarlayıcılar.

Genel özellikler

operasyon

Operation operation

çıktı

::tensorflow::Output output

Kamu işlevleri

Mesafeyi Düzenle

 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
)

Mesafeyi Düzenle

 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 

Genel statik işlevler

Normalleştir

Attrs Normalize(
  bool x
)