过滤#
所有最近邻搜索方法都支持过滤。过滤是一种减少最近邻搜索中考虑的候选数量的方法。
#include <cuvs/neighbors/common.hpp>
命名空间 cuvs::neighbors
-
struct base_filter#
- #include <common.hpp>
子类包括 cuvs::neighbors::filtering::bitmap_filter< bitmap_t, index_t >, cuvs::neighbors::filtering::bitset_filter< bitset_t, index_t >, cuvs::neighbors::filtering::none_sample_filter
-
struct none_sample_filter : public cuvs::neighbors::filtering::base_filter#
- #include <common.hpp>
-
template<typename index_t, typename filter_t>
struct ivf_to_sample_filter# - #include <common.hpp>
用于将 IVF 搜索的聚类索引和样本索引转换为样本索引的过滤器。这可用作中间过滤器。
- 模板参数:
index_t – 索引类型
filter_t –
公有函数
- inline _RAFT_HOST_DEVICE bool operator() (const uint32_t query_ix, const uint32_t cluster_ix, const uint32_t sample_ix) const
如果原始过滤器接受三个参数,则不修改参数。如果原始过滤器接受两个参数,则我们使用
inds_ptr_
来获取样本索引。
-
template<typename bitmap_t, typename index_t>
struct bitmap_filter : public cuvs::neighbors::filtering::base_filter# - #include <common.hpp>
使用位图过滤索引。
- 模板参数:
bitmap_t – 位图的数据类型
index_t – 索引类型
-
template<typename bitset_t, typename index_t>
struct bitset_filter : public cuvs::neighbors::filtering::base_filter# - #include <common.hpp>
使用位集过滤索引。
- 模板参数:
bitset_t – 位集的数据类型
index_t – 索引类型