结构体 faiss::ParameterSpace

struct ParameterSpace

使用关于 Faiss 索引的先验知识来提取可调参数。

faiss::gpu::GpuParameterSpace 继承

公共函数

ParameterSpace()
size_t n_combinations() const

组合的数量, = 值的尺寸的乘积

bool combination_ge(size_t c1, size_t c2) const

返回组合 c1 >= c2 是否在元组意义上成立

std::string combination_name(size_t cno) const

获取组合的字符串表示

void display() const

在 stdout 上打印描述

ParameterRange &add_range(const std::string &name)

添加新参数 (如果存在则返回它)

virtual void initialize(const Index *index)

使用索引的合理参数初始化

void set_index_parameters(Index *index, size_t cno) const

在索引上设置一个参数组合

void set_index_parameters(Index *index, const char *param_string) const

设置由字符串描述的参数组合

virtual void set_index_parameter(Index *index, const std::string &name, double val) const

设置其中一个参数,返回设置是否成功

void update_bounds(size_t cno, const OperatingPoint &op, double *upper_bound_perf, double *lower_bound_t) const

对于给定的另一个工作点 op,找到配置 cno 的性能上限和 t 的下限

void explore(Index *index, size_t nq, const float *xq, const AutoTuneCriterion &crit, OperatingPoints *ops) const

探索操作点

参数:
  • index – 要运行的索引

  • xq – 查询向量 (大小 nq * index.d)

  • crit – 选择标准

  • ops – 结果操作点

inline virtual ~ParameterSpace()

公共成员

std::vector<ParameterRange> parameter_ranges

所有可调整的参数

int verbose

探索期间的详细程度

int n_experiments

优化期间的实验次数(0 = 尝试所有组合)

size_t batchsize

一次提交的最大查询数。

bool thread_over_batches

在批处理中使用多线程(用于基准测试独立的单次搜索很有用)

double min_test_duration

多次运行测试,直到它们至少达到此持续时间(以避免 MT 模式下的抖动)