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.4/api_docs/python/tf/raw_ops/EditDistance