NN Descent
Source header: cuvs/neighbors/nn_descent.hpp
The nn-descent algorithm parameters.
neighbors::nn_descent::DIST_COMP_DTYPE
Dtype to use for distance computation
Values
neighbors::nn_descent::index_params
Parameters used to build an nn-descent index
Fields
neighbors::nn_descent::index_params::index_params
Construct NN descent parameters for a specific kNN graph degree
Parameters
Returns
void
nn-descent index
neighbors::nn_descent::index
nn-descent Build an nn-descent index
The index contains an all-neighbors graph of the input dataset stored in host memory of dimensions (n_rows, n_cols)
Reference: Hui Wang, Wan-Lei Zhao, Xiangxiang Zeng, and Jianye Yang. 2021. Fast k-NN Graph Construction by GPU based NN-Descent. In Proceedings of the 30th ACM International Conference on Information & Knowledge Management (CIKM ‘21). Association for Computing Machinery, New York, NY, USA, 1929–1938. https://doi.org/10.1145/3459637.3482344
neighbors::nn_descent::index::index
Construct a new index object
This constructor creates an nn-descent index which is a knn-graph in host memory. The type of the knn-graph is a dense raft::host_matrix and dimensions are (n_rows, n_cols).
Parameters
Returns
void
Additional overload: neighbors::nn_descent::index::index
Construct a new index object
This constructor creates an nn-descent index using a user allocated host memory knn-graph. The type of the knn-graph is a dense raft::host_matrix and dimensions are (n_rows, n_cols).
distances
Parameters
Returns
void
neighbors::nn_descent::index::metric
Distance metric used for clustering.
Returns
neighbors::nn_descent::index::size
Total length of the index (number of vectors).
Returns
IdxT
neighbors::nn_descent::index::graph_degree
Graph degree
Returns
uint32_t
neighbors::nn_descent::index::graph
neighborhood graph [size, graph-degree]
Returns
raft::host_matrix_view<IdxT, int64_t, raft::row_major>
neighbors::nn_descent::index::distances
neighborhood graph distances [size, graph-degree]
Returns
std::optional<device_matrix_view<float, int64_t, row_major>>
nn-descent index build
neighbors::nn_descent::build
Build nn-descent Index with dataset in device memory
The following distance metrics are supported:
- L2Expanded
- L2SqrtExpanded
- CosineExpanded
- InnerProduct
- L1
Usage example:
the output graph
Parameters
Returns
cuvs::neighbors::nn_descent::index<uint32_t>
Additional overload: neighbors::nn_descent::build
Build nn-descent Index with dataset in host memory
The following distance metrics are supported:
- L2Expanded
- L2SqrtExpanded
- CosineExpanded
- InnerProduct
- L1
Usage example:
the output graph
Template Parameters
Parameters
Returns
cuvs::neighbors::nn_descent::index<uint32_t>
Additional overload: neighbors::nn_descent::build
Build nn-descent Index with dataset in device memory
The following distance metrics are supported:
- L2Expanded
- L2SqrtExpanded
- CosineExpanded
- InnerProduct
- L1
Usage example:
the output graph
Parameters
Returns
cuvs::neighbors::nn_descent::index<uint32_t>
Additional overload: neighbors::nn_descent::build
Build nn-descent Index with dataset in host memory
The following distance metrics are supported:
- L2Expanded
- L2SqrtExpanded
- CosineExpanded
- InnerProduct
- L1
Usage example:
the output graph
Template Parameters
Parameters
Returns
cuvs::neighbors::nn_descent::index<uint32_t>
Additional overload: neighbors::nn_descent::build
Build nn-descent Index with dataset in device memory
The following distance metrics are supported:
- L2Expanded
- L2SqrtExpanded
- CosineExpanded
- InnerProduct
- L1
- BitwiseHamming
Usage example:
the output graph
Parameters
Returns
cuvs::neighbors::nn_descent::index<uint32_t>
Additional overload: neighbors::nn_descent::build
Build nn-descent Index with dataset in host memory
The following distance metrics are supported:
- L2Expanded
- L2SqrtExpanded
- CosineExpanded
- InnerProduct
- L1
- BitwiseHamming
Usage example:
the output graph
Template Parameters
Parameters
Returns
cuvs::neighbors::nn_descent::index<uint32_t>
Additional overload: neighbors::nn_descent::build
Build nn-descent Index with dataset in device memory
The following distance metrics are supported:
- L2Expanded
- L2SqrtExpanded
- CosineExpanded
- InnerProduct
- L1
- BitwiseHamming
Usage example:
the output graph
Parameters
Returns
cuvs::neighbors::nn_descent::index<uint32_t>
Additional overload: neighbors::nn_descent::build
Build nn-descent Index with dataset in host memory
The following distance metrics are supported:
- L2Expanded
- L2SqrtExpanded
- CosineExpanded
- InnerProduct
- L1
- BitwiseHamming
Usage example:
the output graph
Template Parameters
Parameters
Returns