Documentation ¶
Index ¶
- Constants
- func ConcatStrings(strs ...string) string
- func ConvertToFloat32_2DArray(vecs any) ([][]float32, error)
- func CosineDistance(a, b []float32) (float64, error)
- func DotProduct(a, b []float32) (float32, error)
- func EqualFloat32Slices(a, b []float32) bool
- func IsBetterScoreForDistance(a, b float64) bool
- func Normalize(v []float32) ([]float32, error)
- type MaxHeapElement
- type MaxTupleHeap
Constants ¶
View Source
const ( Euclidian = "euclidian" Cosine = "cosine" DotProd = "dotproduct" VecKeyword = "__vector_" VecEntry = "__vector_entry" VecDead = "__vector_dead" VectorIndexMaxLevels = 5 EfConstruction = 16 EfSearch = 12 // ByteData indicates the key stores data. ByteData = byte(0x00) // DefaultPrefix is the prefix used for data, index and reverse keys so that relative DefaultPrefix = byte(0x00) // NsSeparator is the separator between the namespace and attribute. NsSeparator = "-" )
Variables ¶
This section is empty.
Functions ¶
func ConcatStrings ¶
func CosineDistance ¶
assume normalization for vectors
func DotProduct ¶
func EqualFloat32Slices ¶
Types ¶
type MaxHeapElement ¶
type MaxHeapElement struct {
// contains filtered or unexported fields
}
func InitHeapElement ¶
func InitHeapElement( val float64, i string, filteredOut bool) MaxHeapElement
func (MaxHeapElement) GetIndex ¶
func (e MaxHeapElement) GetIndex() string
func (MaxHeapElement) GetValue ¶
func (e MaxHeapElement) GetValue() float64
type MaxTupleHeap ¶
type MaxTupleHeap []MaxHeapElement
func (MaxTupleHeap) Len ¶
func (h MaxTupleHeap) Len() int
func (MaxTupleHeap) Less ¶
func (h MaxTupleHeap) Less(i, j int) bool
func (*MaxTupleHeap) Pop ¶
func (h *MaxTupleHeap) Pop() interface{}
func (*MaxTupleHeap) Push ¶
func (h *MaxTupleHeap) Push(x interface{})
func (MaxTupleHeap) Swap ¶
func (h MaxTupleHeap) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.