텐서플로우::ops::EditDistance

#include <array_ops.h>

(정규화될 수 있는) 레벤슈타인 편집 거리를 계산합니다.

요약

입력은 SparseTensors에서 제공하는 가변 길이 시퀀스(가설 인덱스, 가설 값, 가설 형태) 및 (참 인덱스, 참 값, 참 형태)입니다.

입력값은 다음과 같습니다.

논거:

  • 범위: Scope 객체
  • hypothesis_indices: 가설 목록 SparseTensor의 인덱스입니다. 이는 N x R 크기의 int64 행렬입니다.
  • hypothesis_values: 가설 목록 SparseTensor의 값입니다. 이는 N 길이의 벡터입니다.
  • hypothesis_shape: 가설 목록 SparseTensor의 형태입니다. 이는 R 길이의 벡터입니다.
  • truth_indices: SparseTensor의 진실 목록 인덱스입니다. 이는 M x R 크기의 int64 행렬입니다.
  • truth_values: SparseTensor라는 진리 목록의 값입니다. 이는 M 길이의 벡터입니다.
  • truth_shape: 진실 인덱스, 벡터.

선택적 속성( Attrs 참조):

  • normalize: 부울 값 (true인 경우 편집 거리는 실제 길이로 정규화됩니다).

출력 결과는 다음과 같습니다.

보고:

  • Output : 랭크가 R-1인 밀집 부동소수점 텐서.

예시 입력은 다음과 같습니다.

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

출력 결과는 다음과 같습니다.

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

생성자와 소멸자

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)

공개 속성

operation
output

공공 기능

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

공개 정적 함수

Normalize (bool x)

구조

텐서플로우:: ops:: EditDistance:: Attrs

EditDistance 에 대한 선택적 속성 설정기입니다.

공개 속성

작업

Operation operation

산출

::tensorflow::Output output

공공 기능

편집거리

 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
)

마디

::tensorflow::Node * node() const 

연산자::텐서플로우::입력

 operator::tensorflow::Input() const 

연산자::텐서플로우::출력

 operator::tensorflow::Output() const 

공개 정적 함수

정규화

Attrs Normalize(
  bool x
)