tf.raw_ops.EditDistance
Вычисляет (возможно, нормализованное) расстояние редактирования Левенштейна.
tf.raw_ops.EditDistance(
hypothesis_indices, hypothesis_values, hypothesis_shape, truth_indices,
truth_values, truth_shape, normalize=True, name=None
)
Входные данные — это последовательности переменной длины, предоставляемые SparseTensors (hypothesis_indices, hypothesis_values, hypothesis_shape) и (truth_indices, truth_values, truth_shape).
Входные данные:
| Аргументы | |
|---|---|
hypothesis_indices | A Tensor типа int64. Индексы SparseTensor списка гипотез. Это матрица N x R типа int64. |
hypothesis_values | A Tensor. Значения SparseTensor списка гипотез. Это вектор длины N. |
hypothesis_shape | A Tensor типа int64. Форма SparseTensor списка гипотез. Это вектор длины R. |
truth_indices | A Tensor типа int64. Индексы SparseTensor списка истинности. Это матрица M x R типа int64. |
truth_values | A Tensor. Должен иметь тот же тип, что и hypothesis_values. Значения SparseTensor списка истинности. Это вектор длины M. |
truth_shape | A Tensor типа int64. Индексы списка истинности, вектор. |
normalize | Необязательный bool. По умолчанию True. Булево значение (если true, расстояния редактирования нормализуются по длине списка истинности). Результат: |
name | Имя операции (необязательно). |
| Возвращаемое значение | |
|---|---|
A Tensor типа float32. |
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/raw_ops/EditDistance