Faiss

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
faiss::ScalarQuantizer Struct Reference

`#include <IndexScalarQuantizer.h>`

## Classes
struct | DistanceComputer

## Public Types
enum | QuantizerType { QT_8bit, QT_4bit, QT_8bit_uniform, QT_4bit_uniform, QT_fp16 }
enum | RangeStat { 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)
DistanceComputer * | get_distance_computer (MetricType metric=METRIC_L2) const

## 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)

## Detailed Description

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 32 of file IndexScalarQuantizer.h.

## Member Enumeration Documentation

enum faiss::ScalarQuantizer::QuantizerType

Enumerator
QT_8bit | 8 bits per component
QT_4bit | 4 bits per component
QT_8bit_uniform | same, shared range for all dimensions

Definition at line 34 of file IndexScalarQuantizer.h.

enum faiss::ScalarQuantizer::RangeStat

The uniform encoder can estimate the range of representable values of the unform encoder using different statistics. Here rs = rangestat_arg

Enumerator
RS_minmax | [min - rs*(max-min), max + rs*(max-min)]
RS_meanstd | [mean - std * rs, mean + std * rs]
RS_quantiles | [Q(rs), Q(1-rs)]
RS_optim | alternate optimization of reconstruction error

Definition at line 49 of file IndexScalarQuantizer.h.

The documentation for this struct was generated from the following files:

- /tmp/faiss/IndexScalarQuantizer.h
- /tmp/faiss/IndexScalarQuantizer.cpp