przepływ tensorowy:: ops:: Edytuj Odległość

#include <array_ops.h>

Oblicza (prawdopodobnie znormalizowaną) odległość edycji Levenshteina.

Streszczenie

Dane wejściowe to sekwencje o zmiennej długości dostarczane przez SparseTensors (indices_hipotezy, wartości_hipotezy, kształt_hipotezy) i (indices_prawdy, wartości_prawdy, kształt_prawdy).

Dane wejściowe to:

Argumenty:

  • zakres: Obiekt Scope
  • hipoteza_indices: Indeksy listy hipotez SparseTensor. To jest macierz N x R int64.
  • wartości_hipotezy: Wartości listy hipotez SparseTensor. To jest wektor o długości N.
  • hipoteza_shape: Kształt listy hipotez SparseTensor. To jest wektor o długości R.
  • true_indices: Indeksy listy prawdy SparseTensor. To jest macierz M x R int64.
  • wartości_prawdy: Wartości listy prawdy SparseTensor. To jest wektor o długości M.
  • true_shape: wskaźniki prawdy, wektor.

Opcjonalne atrybuty (patrz Attrs ):

  • normalize: boolean (jeśli prawda, odległości edycji są normalizowane według długości prawdy).

Dane wyjściowe to:

Zwroty:

  • Output : gęsty tensor zmiennoprzecinkowy o randze R - 1.

Dla przykładowego wejścia:

// 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

Dane wyjściowe będą następujące:

// 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  

Konstruktory i destruktory

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)

Atrybuty publiczne

operation
output

Funkcje publiczne

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

Publiczne funkcje statyczne

Normalize (bool x)

Struktury

tensorflow:: ops:: EditDistance:: Attrs

Opcjonalne moduły ustawiające atrybuty dla EditDistance .

Atrybuty publiczne

operacja

Operation operation

wyjście

::tensorflow::Output output

Funkcje publiczne

Edytuj Odległość

 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
)

Edytuj Odległość

 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
)

węzeł

::tensorflow::Node * node() const 

operator::tensorflow::Wejście

 operator::tensorflow::Input() const 

operator::tensorflow::Wyjście

 operator::tensorflow::Output() const 

Publiczne funkcje statyczne

Normalizować

Attrs Normalize(
  bool x
)