Ivf Flat Package
Go package: ivf_flat
Sources: go/ivf_flat
Types
IndexParams
Supplemental parameters to build IVF Flat Index
Source: go/ivf_flat/index_params.go:13
IvfFlatIndex
IVF Flat Index
Source: go/ivf_flat/ivf_flat.go:14
SearchParams
Source: go/ivf_flat/search_params.go:10
Functions
BuildIndex
Builds an IvfFlatIndex from the dataset for efficient search.
Arguments
Resources- Resources to useparams- Parameters for building the indexdataset- A row-major Tensor on either the host or device to indexindex- IvfFlatIndex to build
Source: go/ivf_flat/ivf_flat.go:38
CreateIndex
Creates a new empty IvfFlatIndex
Source: go/ivf_flat/ivf_flat.go:20
CreateIndexParams
Creates a new IndexParams
Source: go/ivf_flat/index_params.go:18
CreateSearchParams
Creates a new SearchParams
Source: go/ivf_flat/search_params.go:15
GetCenters
Source: go/ivf_flat/ivf_flat.go:108
GetDim
Source: go/ivf_flat/ivf_flat.go:93
GetNLists
Source: go/ivf_flat/ivf_flat.go:78
SearchIndex
Perform a Approximate Nearest Neighbors search on the Index
Arguments
Resources- Resources to useparams- Parameters to use in searching the indexindex- IvfFlatIndex to searchqueries- A tensor in device memory to query forneighbors- Tensor in device memory that receives the indices of the nearest neighborsdistances- Tensor in device memory that receives the distances of the nearest neighbors
Source: go/ivf_flat/ivf_flat.go:66
Methods
IndexParams.Close
Destroys IndexParams
Source: go/ivf_flat/index_params.go:81
IndexParams.SetAddDataOnBuild
After training the coarse and fine quantizers, we will populate the index with the dataset if add_data_on_build == true, otherwise the index is left empty, and the extend method can be used to add new vectors to the index.
Source: go/ivf_flat/index_params.go:71
IndexParams.SetKMeansNIters
The number of iterations searching for kmeans centers during index building.
Source: go/ivf_flat/index_params.go:54
IndexParams.SetKMeansTrainsetFraction
If kmeans_trainset_fraction is less than 1, then the dataset is subsampled, and only n_samples * kmeans_trainset_fraction rows are used for training.
Source: go/ivf_flat/index_params.go:62
IndexParams.SetMetric
Distance Type to use for building the index
Source: go/ivf_flat/index_params.go:36
IndexParams.SetMetricArg
Metric argument for Minkowski distances - set to 2.0 if not applicable
Source: go/ivf_flat/index_params.go:48
IndexParams.SetNLists
The number of clusters used in the coarse quantizer.
Source: go/ivf_flat/index_params.go:30
IvfFlatIndex.Close
Destroys the IvfFlatIndex
Source: go/ivf_flat/ivf_flat.go:48
SearchParams.Close
Destroy SearchParams
Source: go/ivf_flat/search_params.go:33
SearchParams.SetNProbes
The number of clusters to search.
Source: go/ivf_flat/search_params.go:27