Namespace faiss::lsq

namespace lsq
struct IcmEncoder

Subclassed by faiss::gpu::GpuIcmEncoder

Public Functions

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

compute binary terms

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

Encode vectors given codebooks

Parameters:
  • codes – output codes, size n * M

  • x – vectors to encode, size n * d

  • gen – random generator

  • n – number of vectors

  • ils_iters – number of iterations of iterative local search

Public Members

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

Subclassed by faiss::gpu::GpuIcmEncoderFactory

Public Functions

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

A helper struct to count consuming time during training. It is NOT thread-safe.

Public Functions

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

Public Members

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

Public Functions

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

Public Members

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