Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLastError ¶
func GetLastError() error
Types ¶
type Index ¶
type Index interface { Train(vecsFlat []float32) error Add(vecsFlat []float32) error AddWithIds(vecsFlat []float32, ids []int64) error RemoveIds(n int64, ids []int64) error Search(queryVectsFlat []float32, k int64) ([]int64, []float32, error) Reconstruct(id int64) ([]float32, error) // can be used to fetch a vector for any type of index (i think) ReconstructN(id int64, n int64) ([]float32, error) // Reconstruct vectors id to id + n - 1 WriteToDisk(path string) error LoadFromDisk(path string) error IsTrained() bool NTotal() int64 Free() }
func IndexFactory ¶
func IndexFactory(dim int, desc string, metric MetricType) (Index, error)
desc: https://github.com/facebookresearch/faiss/wiki/The-index-factory
type MetricType ¶
type MetricType int
const ( MetricInnerProduct MetricType = C.METRIC_INNER_PRODUCT MetricL2 MetricType = C.METRIC_L2 MetricL1 MetricType = C.METRIC_L1 MetricLinf MetricType = C.METRIC_Linf MetricLp MetricType = C.METRIC_Lp MetricCanberra MetricType = C.METRIC_Canberra MetricBrayCurtis MetricType = C.METRIC_BrayCurtis MetricJensenShannon MetricType = C.METRIC_JensenShannon )
Click to show internal directories.
Click to hide internal directories.