#include <VectorTransform.h>
Public Types | |
typedef Index::idx_t | idx_t |
Public Member Functions | |
VectorTransform (int d_in=0, int d_out=0) | |
! output dimension | |
virtual void | train (idx_t n, const float *x) |
float * | apply (idx_t n, const float *x) const |
virtual void | apply_noalloc (idx_t n, const float *x, float *xt) const =0 |
same as apply, but result is pre-allocated | |
virtual void | reverse_transform (idx_t n, const float *xt, float *x) const |
Public Attributes | |
int | d_in |
int | d_out |
! input dimension | |
bool | is_trained |
Any transformation applied on a set of vectors
Definition at line 29 of file VectorTransform.h.
float * VectorTransform::apply | ( | Index::idx_t | n, |
const float * | x | ||
) | const |
apply the random roation, return new allocated matrix
x | size n * d_in |
Definition at line 68 of file VectorTransform.cpp.
|
virtual |
reverse transformation. May not be implemented or may return approximate result
Reimplemented in faiss::RemapDimensionsTransform, faiss::OPQMatrix, faiss::PCAMatrix, and faiss::RandomRotationMatrix.
Definition at line 81 of file VectorTransform.cpp.
|
virtual |
Perform training on a representative set of vectors. Does nothing by default.
n | nb of training vectors |
x | training vecors, size n * d |
Reimplemented in faiss::OPQMatrix, and faiss::PCAMatrix.
Definition at line 76 of file VectorTransform.cpp.
bool faiss::VectorTransform::is_trained |
set if the LinearTransform does not require training, or if training is done already
Definition at line 43 of file VectorTransform.h.