命名空间 faiss::lsq

namespace lsq
struct IcmEncoder

faiss::gpu::GpuIcmEncoder 继承

公共函数

explicit IcmEncoder(const LocalSearchQuantizer *lsq)
inline virtual ~IcmEncoder()

计算二进制项

virtual void set_binary_term()
virtual void encode(int32_t *codes, const float *x, std::mt19937 &gen, size_t n, size_t ils_iters) const

对给定码本的向量进行编码

参数:
  • codes – 输出码,大小为 n * M

  • x – 要编码的向量,大小为 n * d

  • gen – 随机数生成器

  • n – 向量的数量

  • ils_iters – 迭代局部搜索的迭代次数

公共成员

std::vector<float> binaries
bool verbose
const LocalSearchQuantizer *lsq
struct IcmEncoderFactory

faiss::gpu::GpuIcmEncoderFactory 继承

公共函数

inline virtual IcmEncoder *get(const LocalSearchQuantizer *lsq)
inline virtual ~IcmEncoderFactory()
struct LSQTimer
#include <LocalSearchQuantizer.h>

一个辅助结构体,用于计算训练期间的耗时。它不是线程安全的。

公共函数

inline LSQTimer()
double get(const std::string &name)
void add(const std::string &name, double delta)
void reset()

公共成员

std::unordered_map<std::string, double> t
struct LSQTimerScope

公共函数

LSQTimerScope(LSQTimer *timer, std::string name)
void finish()
~LSQTimerScope()

公共成员

double t0
LSQTimer *timer
std::string name
bool finished