Faiss

- Main Page
- Namespaces
- Classes
- Files

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

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

`#include <VectorTransform.h>`

Inheritance diagram for faiss::VectorTransform:

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

## Detailed Description

Any transformation applied on a set of vectors

Definition at line 26 of file VectorTransform.h.

## Member Function Documentation

float * VectorTransform::apply | ( | Index::idx_t | n,
|  | const float * | x
| ) |  | const

apply the random roation, return new allocated matrix

Parameters

  x | size n * d_in

Returns
  size n * d_out

Definition at line 70 of file VectorTransform.cpp.

void VectorTransform::reverse_transform | ( | idx_t | n,
|  | const float * | xt,
|  | float * | x
| ) |  | const
| virtual

reverse transformation. May not be implemented or may return approximate result

Reimplemented in faiss::CenteringTransform, faiss::NormalizationTransform, faiss::RemapDimensionsTransform, and faiss::LinearTransform.

Definition at line 83 of file VectorTransform.cpp.

void VectorTransform::train | ( | idx_t | n,
|  | const float * | x
| ) |  |
| virtual

Perform training on a representative set of vectors. Does nothing by default.

Parameters

  n | nb of training vectors
  x | training vecors, size n * d

Reimplemented in faiss::CenteringTransform, faiss::OPQMatrix, faiss::PCAMatrix, and faiss::RandomRotationMatrix.

Definition at line 78 of file VectorTransform.cpp.

## Member Data Documentation

bool faiss::VectorTransform::is_trained

set if the VectorTransform does not require training, or if training is done already

Definition at line 40 of file VectorTransform.h.

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

- /data/users/hoss/faiss/VectorTransform.h
- /data/users/hoss/faiss/VectorTransform.cpp