knncolle_hnsw
knncolle bindings for HNSW
Loading...
Searching...
No Matches
knncolle_hnsw::DistanceConfig< Distance_, HnswData_ > Struct Template Reference

Distance configuration for the HNSW index. More...

#include <distances.hpp>

Public Attributes

std::function< hnswlib::SpaceInterface< HnswData_ > *(std::size_t)> create
 
DistanceNormalizeMethod normalize_method
 
std::function< Distance_(Distance_)> custom_normalize
 

Detailed Description

template<typename Distance_, typename HnswData_ = float>
struct knncolle_hnsw::DistanceConfig< Distance_, HnswData_ >

Distance configuration for the HNSW index.

Template Parameters
Distance_Floating-point type for the distances.
HnswData_Floating-point type for data in the HNSW index.

Member Data Documentation

◆ create

template<typename Distance_ , typename HnswData_ = float>
std::function<hnswlib::SpaceInterface<HnswData_>*(std::size_t)> knncolle_hnsw::DistanceConfig< Distance_, HnswData_ >::create

Function that returns a pointer to a hnswlib::SpaceInterface instance, given the number of dimensions.

◆ custom_normalize

template<typename Distance_ , typename HnswData_ = float>
std::function<Distance_(Distance_)> knncolle_hnsw::DistanceConfig< Distance_, HnswData_ >::custom_normalize

Normalization function to convert the output of hnswlib::SpaceInterface::get_dist_func() into actual distances. This must be provided if normalize_method = DistanceNormalizeMethod::CUSTOM, otherwise it is ignored.

◆ normalize_method

template<typename Distance_ , typename HnswData_ = float>
DistanceNormalizeMethod knncolle_hnsw::DistanceConfig< Distance_, HnswData_ >::normalize_method

Method for normalizing distances.


The documentation for this struct was generated from the following file: