#include <IndexIVFScalarQuantizer.h>
Public Types | |
enum | QuantizerType { QT_8bit, QT_4bit, QT_8bit_uniform, QT_4bit_uniform, QT_8bit, QT_4bit, QT_8bit_uniform, QT_4bit_uniform } |
enum | RangeStat { RS_minmax, RS_meanstd, RS_quantiles, RS_optim, RS_minmax, RS_meanstd, RS_quantiles, RS_optim } |
enum | QuantizerType { QT_8bit, QT_4bit, QT_8bit_uniform, QT_4bit_uniform, QT_8bit, QT_4bit, QT_8bit_uniform, QT_4bit_uniform } |
enum | RangeStat { RS_minmax, RS_meanstd, RS_quantiles, RS_optim, RS_minmax, RS_meanstd, RS_quantiles, RS_optim } |
Public Member Functions | |
ScalarQuantizer (size_t d, QuantizerType qtype) | |
void | train (size_t n, const float *x) |
void | compute_codes (const float *x, uint8_t *codes, size_t n) const |
same as compute_code for several vectors | |
void | decode (const uint8_t *code, float *x, size_t n) const |
decode a vector from a given code (or n vectors if third argument) | |
ScalarQuantizer (size_t d, QuantizerType qtype) | |
void | train (size_t n, const float *x) |
void | compute_codes (const float *x, uint8_t *codes, size_t n) const |
same as compute_code for several vectors | |
void | decode (const uint8_t *code, float *x, size_t n) const |
decode a vector from a given code (or n vectors if third argument) | |
Public Attributes | |
QuantizerType | qtype |
RangeStat | rangestat |
float | rangestat_arg |
size_t | d |
dimension of input vectors | |
size_t | code_size |
bytes per vector | |
std::vector< float > | trained |
trained values (including the range) | |
An IVF implementation where the components of the residuals are encoded with a scalar uniform quantizer. All distance computations are asymmetric, so the encoded vectors are decoded and approximate distances are computed.
The uniform quantizer has a range [vmin, vmax]. The range can be the same for all dimensions (uniform) or specific per dimension (default).
The uniform quantizer has a range [vmin, vmax]. The range can be the same for all dimensions (uniform) or specific per dimension (default).
Definition at line 34 of file IndexIVFScalarQuantizer.h.
Definition at line 32 of file IndexScalarQuantizer.h.
Definition at line 36 of file IndexIVFScalarQuantizer.h.
The uniform encoder can estimate the range of representable values of the unform encoder using different statistics. Here rs = rangestat_arg
Definition at line 46 of file IndexScalarQuantizer.h.
The uniform encoder can estimate the range of representable values of the unform encoder using different statistics. Here rs = rangestat_arg
Definition at line 50 of file IndexIVFScalarQuantizer.h.