텐서플로우:: 작전:: 편집거리
#include <array_ops.h>
(정규화된) Levenshtein Edit Distance를 계산합니다.
요약
입력은 SparseTensors(hypoesis_indices, Hypothese_values, Hypothese_shape) 및 (truth_indices, Truth_values, Truth_shape)에서 제공하는 가변 길이 시퀀스입니다.
입력은 다음과 같습니다:
인수:
- 범위: 범위 개체
- hypothetical_indices: 가설 목록 SparseTensor의 인덱스입니다. 이것은 N x R int64 행렬입니다.
- 가설_값: 가설 목록 SparseTensor의 값입니다. 이것은 N 길이 벡터입니다.
- hypothetical_shape: 가설 목록 SparseTensor의 모양입니다. 이것은 R 길이 벡터입니다.
- 진실_인덱스: 진실 목록 SparseTensor의 인덱스입니다. 이것은 M x R int64 행렬입니다.
- 진실_값: 진실 목록 SparseTensor의 값입니다. 이것은 M 길이의 벡터입니다.
- 진실_모양: 진실 지수, 벡터.
선택적 속성( 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) |
공공 기능 | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
구조체 | |
---|---|
텐서플로우:: 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