Zadbaj o dobrą organizację dzięki kolekcji Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.

tensorflow :: ops :: EditDistance

#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 (hypothesis_indices, hypothesis_values, hypothesis_shape) i (true_indices, true_values, true_shape).

Dane wejściowe to:

Argumenty:

  • zakres: obiekt Scope
  • hypothesis_indices: indeksy listy hipotez SparseTensor. To jest macierz N x R int64.
  • hypothesis_values: wartości z listy hipotez SparseTensor. To jest wektor o długości N.
  • hypothesis_shape: Kształt listy hipotez SparseTensor. To jest wektor 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.
  • kształt_prawdy: wskaźniki prawdy, wektor.

Atrybuty opcjonalne (patrz Attrs ):

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

Wynik to:

Zwroty:

  • Output : Gęsty tensor pływakowy o randze R - 1.

Na przykład wejście:

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

Wynik będzie następujący:

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

Konstruktorzy i niszczyciele

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 metody ustawiające atrybuty dla EditDistance .

Atrybuty publiczne

operacja

Operation operation

wynik

::tensorflow::Output output

Funkcje publiczne

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
)

węzeł

::tensorflow::Node * node() const 

operator :: tensorflow :: Input

 operator::tensorflow::Input() const 

operator :: tensorflow :: Output

 operator::tensorflow::Output() const 

Publiczne funkcje statyczne

Normalizować

Attrs Normalize(
  bool x
)