Randomly rotate a set of vectors. More...
#include <VectorTransform.h>
Public Member Functions | |
RandomRotationMatrix (int d_in, int d_out) | |
both d_in > d_out and d_out < d_in are supported | |
void | init (int seed) |
must be called before the transform is used | |
void | train (Index::idx_t n, const float *x) 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 |
void | reverse_transform (idx_t n, const float *xt, float *x) const override |
works only if is_orthonormal | |
void | set_is_orthonormal () |
compute A^T * A to set the is_orthonormal flag | |
![]() | |
VectorTransform (int d_in=0, int d_out=0) | |
! output dimension | |
float * | apply (idx_t n, const float *x) const |
Additional Inherited Members | |
![]() | |
typedef Index::idx_t | idx_t |
![]() | |
bool | have_bias |
bool | is_orthonormal |
! whether to use the bias term More... | |
std::vector< float > | A |
Transformation matrix, size d_out * d_in. | |
std::vector< float > | b |
bias vector, size d_out | |
bool | verbose |
![]() | |
int | d_in |
int | d_out |
! input dimension | |
bool | is_trained |
Randomly rotate a set of vectors.
Definition at line 115 of file VectorTransform.h.
|
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 242 of file VectorTransform.cpp.