Google I/O'yu ayarladığınız için teşekkür ederiz. İsteğe bağlı olarak tüm oturumları görüntüleyin İsteğe bağlı olarak izleyin

tensorflow :: ops :: EditDistance

#include <array_ops.h>

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

Özet

Girişler, 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:

Argümanlar:

  • kapsam: Bir Scope nesnesi
  • hypothesis_indices: Hipotez listesinin indisleri SparseTensor. Bu bir N x R int64 matrisidir.
  • hipotez_değerleri: Hipotez listesinin değerleri SparseTensor. Bu, N-uzunluklu bir vektördür.
  • hypothesis_shape: Hipotez listesinin şekli SparseTensor. Bu bir R-uzunluk vektörüdür.
  • true_indices: SparseTensor doğruluk listesinin indeksleri. Bu bir M x R int64 matrisidir.
  • true_values: SparseTensor doğruluk listesinin değerleri. Bu, M uzunluğunda bir vektördür.
  • true_shape: doğruluk endeksleri, vektör.

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

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

Çıktı:

İadeler:

  • Output : R - 1 ranklı yoğun bir float 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ı ş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

Genel statik işlevler

Normalize (bool x)

Yapılar

tensorflow :: ops :: EditDistance :: Attrs

EditDistance için isteğe bağlı öznitelik belirleyiciler.

Genel özellikler

operasyon

Operation operation

çıktı

::tensorflow::Output output

Kamusal işlevler

EditDistance

 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

 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 

operator :: tensorflow :: Girdi

 operator::tensorflow::Input() const 

operator :: tensorflow :: Çıktı

 operator::tensorflow::Output() const 

Genel statik işlevler

Normalleştir

Attrs Normalize(
  bool x
)