Attention
The vector search and clustering algorithms in RAFT are being migrated to a new library dedicated to vector search called cuVS. We will continue to support the vector search algorithms in RAFT during this move, but will no longer update them after the RAPIDS 24.06 (June) release. We plan to complete the migration by RAPIDS 24.10 (October) release and they will be removed from RAFT altogether in the 24.12 (December) release.
Distance#
This page provides C++ class references for the publicly-exposed elements of the raft/distance
package. RAFT’s
distances have been highly optimized and support a wide assortment of different distance measures.
Distance Types#
#include <raft/distance/distance_types.hpp>
namespace raft::distance
-
enum raft::distance::DistanceType#
enum to tell how to compute distance
Values:
-
enumerator L2Expanded#
evaluate as dist_ij = sum(x_ik^2) + sum(y_ij)^2 - 2*sum(x_ik * y_jk)
-
enumerator L2SqrtExpanded#
same as above, but inside the epilogue, perform square root operation
-
enumerator CosineExpanded#
cosine distance
-
enumerator L1#
L1 distance
-
enumerator L2Unexpanded#
evaluate as dist_ij += (x_ik - y-jk)^2
-
enumerator L2SqrtUnexpanded#
same as above, but inside the epilogue, perform square root operation
-
enumerator InnerProduct#
basic inner product
-
enumerator Linf#
Chebyshev (Linf) distance
-
enumerator Canberra#
Canberra distance
-
enumerator LpUnexpanded#
Generalized Minkowski distance
-
enumerator CorrelationExpanded#
Correlation distance
-
enumerator JaccardExpanded#
Jaccard distance
-
enumerator HellingerExpanded#
Hellinger distance
-
enumerator Haversine#
Haversine distance
-
enumerator BrayCurtis#
Bray-Curtis distance
-
enumerator JensenShannon#
Jensen-Shannon distance
-
enumerator HammingUnexpanded#
Hamming distance
-
enumerator KLDivergence#
KLDivergence
-
enumerator RusselRaoExpanded#
RusselRao
-
enumerator DiceExpanded#
Dice-Sorensen distance
-
enumerator Precomputed#
Precomputed (special value)
-
enumerator L2Expanded#