nanofaiss

package module
v0.0.0-...-a21052a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 4 Imported by: 0

README

nanoFaiss

nanoFaiss - a simple and efficient library for similarity search and clustering of dense vectors. referenced to Meta's Faiss, but using the Golang programming language.

Features

  • Support L2, InnerProduct, Cosine similarity
  • Support IndexFlat index
  • Support IndexIVFFlat index
  • Support IndexLSH index
  • Support IndexPQ index
  • Support IndexIVFPQ index
  • Support IndexHNSW index

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index interface {
	Init(n int32, d int32)
	Search(x []float64, k int32, metric_type MetricType) ([]int32, [][]float64)
	Add(x []float64)
	BatchAdd(x [][]float64)
	Remove()
}

type IndexFlat

type IndexFlat struct {
	// contains filtered or unexported fields
}

func (*IndexFlat) Add

func (iflat *IndexFlat) Add(x []float64)

func (*IndexFlat) BatchAdd

func (iflat *IndexFlat) BatchAdd(x [][]float64)

func (*IndexFlat) Init

func (iflat *IndexFlat) Init(n int32, d int32)

func (*IndexFlat) Remove

func (iflat *IndexFlat) Remove()

func (*IndexFlat) Search

func (iflat *IndexFlat) Search(x []float64, k int32, metric_type MetricType) ([]int32, [][]float64)

type IndexIVFFlat

type IndexIVFFlat struct {
	// contains filtered or unexported fields
}

func (*IndexIVFFlat) Search

func (ivf *IndexIVFFlat) Search(x []float64, k int32, nprobe int32) ([]int32, [][]float64)

func (*IndexIVFFlat) Train

func (ivf *IndexIVFFlat) Train(index_flat *IndexFlat, nlist int32, max_iterations int32, delta_threshold float64)

type MetricType

type MetricType int
const (
	METRIC_L2 MetricType = iota
	METRIC_IP
	METRIC_COSINE
)

similarity metric type

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL