Spec-Zone.ru › TensorFlow

tf.raw_ops.NearestNeighbors

Selects the k nearest centers for each point.

View aliases

Compat aliases for migration

See Migration guide for more details.

tf.compat.v1.raw_ops.NearestNeighbors

tf.raw_ops.NearestNeighbors(
    points, centers, k, name=None
)

Rows of points are assumed to be input points. Rows of centers are assumed to be the list of candidate centers. For each point, the k centers that have least L2 distance to it are computed.

Args
points A Tensor of type float32. Matrix of shape (n, d). Rows are assumed to be input points.
centers A Tensor of type float32. Matrix of shape (m, d). Rows are assumed to be centers.
k A Tensor of type int64. Number of nearest centers to return for each point. If k is larger than m, then only m centers are returned.
name A name for the operation (optional).
Returns
A tuple of Tensor objects (nearest_center_indices, nearest_center_distances).
nearest_center_indices A Tensor of type int64.
nearest_center_distances A Tensor of type float32.

© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/raw_ops/NearestNeighbors

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API