Documentation ¶
Index ¶
- Constants
- func EstimateHNSWBuilderComplexity(dataSize, trials int) int
- func EstimateIVFBuilderComplexity(num, numEpoch int) int
- type Bruteforce
- type CentroidVector
- type DenseVector
- type DictionaryCentroidVector
- type DictionaryVector
- func (v DictionaryVector) Centroid(vectors []Vector, indices []int32) CentroidVector
- func (v *DictionaryVector) Distance(vector Vector) float32
- func (v *DictionaryVector) Dot(vector *DictionaryVector) (float32, float32)
- func (v *DictionaryVector) IsHidden() bool
- func (v *DictionaryVector) Terms() []string
- type HNSW
- type HNSWBuilder
- type HNSWConfig
- type IVF
- type IVFBuilder
- type IVFConfig
- type Vector
- type VectorIndex
Constants ¶
View Source
const ( DefaultTestSize = 1000 DefaultMaxIter = 100 )
Variables ¶
This section is empty.
Functions ¶
func EstimateHNSWBuilderComplexity ¶ added in v0.4.5
func EstimateIVFBuilderComplexity ¶ added in v0.4.5
Types ¶
type Bruteforce ¶
type Bruteforce struct {
// contains filtered or unexported fields
}
Bruteforce is a naive implementation of vector index.
func NewBruteforce ¶
func NewBruteforce(vectors []Vector) *Bruteforce
NewBruteforce creates a Bruteforce vector index.
func (*Bruteforce) Build ¶
func (b *Bruteforce) Build(_ context.Context)
Build a vector index on data.
func (*Bruteforce) MultiSearch ¶
type CentroidVector ¶ added in v0.4.2
type DenseVector ¶
type DenseVector struct {
// contains filtered or unexported fields
}
func NewDenseVector ¶
func NewDenseVector(data []float32, terms []string, isHidden bool) *DenseVector
func (*DenseVector) Centroid ¶ added in v0.4.2
func (v *DenseVector) Centroid(_ []Vector, _ []int32) CentroidVector
func (*DenseVector) Distance ¶
func (v *DenseVector) Distance(vector Vector) float32
func (*DenseVector) IsHidden ¶
func (v *DenseVector) IsHidden() bool
func (*DenseVector) Terms ¶
func (v *DenseVector) Terms() []string
type DictionaryCentroidVector ¶ added in v0.4.2
type DictionaryCentroidVector struct {
// contains filtered or unexported fields
}
func (*DictionaryCentroidVector) Distance ¶ added in v0.4.2
func (v *DictionaryCentroidVector) Distance(vector Vector) float32
type DictionaryVector ¶
type DictionaryVector struct {
// contains filtered or unexported fields
}
func NewDictionaryVector ¶
func NewDictionaryVector(indices []int32, values []float32, terms []string, isHidden bool) *DictionaryVector
func (DictionaryVector) Centroid ¶ added in v0.4.2
func (v DictionaryVector) Centroid(vectors []Vector, indices []int32) CentroidVector
func (*DictionaryVector) Distance ¶
func (v *DictionaryVector) Distance(vector Vector) float32
func (*DictionaryVector) Dot ¶
func (v *DictionaryVector) Dot(vector *DictionaryVector) (float32, float32)
func (*DictionaryVector) IsHidden ¶
func (v *DictionaryVector) IsHidden() bool
func (*DictionaryVector) Terms ¶
func (v *DictionaryVector) Terms() []string
type HNSW ¶
type HNSW struct {
// contains filtered or unexported fields
}
HNSW is a vector index based on Hierarchical Navigable Small Worlds.
func NewHNSW ¶
func NewHNSW(vectors []Vector, configs ...HNSWConfig) *HNSW
NewHNSW builds a vector index based on Hierarchical Navigable Small Worlds.
func (*HNSW) MultiSearch ¶
type HNSWBuilder ¶
type HNSWBuilder struct {
// contains filtered or unexported fields
}
func NewHNSWBuilder ¶
func NewHNSWBuilder(data []Vector, k, numJobs int) *HNSWBuilder
type HNSWConfig ¶
type HNSWConfig func(*HNSW)
HNSWConfig is the configuration function for HNSW.
func SetEF ¶
func SetEF(ef int) HNSWConfig
SetEF sets the EF search value in HNSW. By default ef for search is the same as efConstruction. To return it to this default behavior, set it to 0.
func SetEFConstruction ¶
func SetEFConstruction(efConstruction int) HNSWConfig
SetEFConstruction sets efConstruction in HNSW.
func SetHNSWNumJobs ¶
func SetHNSWNumJobs(numJobs int) HNSWConfig
SetHNSWNumJobs sets the number of jobs for building index.
func SetMaxConnection ¶
func SetMaxConnection(maxConnection int) HNSWConfig
SetMaxConnection sets the number of connections in HNSW.
type IVFBuilder ¶
type IVFBuilder struct {
// contains filtered or unexported fields
}
func NewIVFBuilder ¶
func NewIVFBuilder(data []Vector, k int, configs ...IVFConfig) *IVFBuilder
type IVFConfig ¶
type IVFConfig func(ivf *IVF)
func SetClusterErrorRate ¶
func SetIVFJobsAllocator ¶ added in v0.4.6
func SetIVFJobsAllocator(jobsAlloc *task.JobsAllocator) IVFConfig
func SetMaxIteration ¶ added in v0.4.5
func SetNumProbe ¶
Click to show internal directories.
Click to hide internal directories.