#include <VectorTransform.h>
Public Member Functions | |
OPQMatrix (int d=0, int M=1, int d2=-1) | |
if d2 != -1, output vectors of this dimension | |
void | train (Index::idx_t n, const float *x) override |
void | reverse_transform (idx_t n, const float *xt, float *x) const override |
![]() | |
LinearTransform (int d_in=0, int d_out=0, bool have_bias=false) | |
both d_in > d_out and d_out < d_in are supported | |
void | apply_noalloc (idx_t n, const float *x, float *xt) const override |
same as apply, but result is pre-allocated | |
void | transform_transpose (idx_t n, const float *y, float *x) const |
![]() | |
VectorTransform (int d_in=0, int d_out=0) | |
! output dimension | |
float * | apply (idx_t n, const float *x) const |
Public Attributes | |
int | M |
nb of subquantizers | |
int | niter |
Number of outer training iterations. | |
int | niter_pq |
Number of training iterations for the PQ. | |
int | niter_pq_0 |
same, for the first outer iteration | |
size_t | max_train_points |
if there are too many training points, resample | |
bool | verbose |
![]() | |
bool | have_bias |
std::vector< float > | A |
! whether to use the bias term More... | |
std::vector< float > | b |
bias vector, size d_out | |
bool | verbose |
![]() | |
int | d_in |
int | d_out |
! input dimension | |
bool | is_trained |
Additional Inherited Members | |
![]() | |
typedef Index::idx_t | idx_t |
Applies a rotation to align the dimensions with a PQ to minimize the reconstruction error. Can be used before an IndexPQ or an IndexIVFPQ. The method is the non-parametric version described in:
"Optimized Product Quantization for Approximate Nearest Neighbor Search" Tiezheng Ge, Kaiming He, Qifa Ke, Jian Sun, CVPR'13
Definition at line 180 of file VectorTransform.h.
|
overridevirtual |
reverse transformation. May not be implemented or may return approximate result
Reimplemented from faiss::VectorTransform.
Definition at line 708 of file VectorTransform.cpp.
|
overridevirtual |
Perform training on a representative set of vectors. Does nothing by default.
n | nb of training vectors |
x | training vecors, size n * d |
Reimplemented from faiss::VectorTransform.
Definition at line 547 of file VectorTransform.cpp.