Documentation
¶
Index ¶
- Constants
- Variables
- func CalcFFBatch(dim int64, left []float32, lIndex int64, right []float32, metric string, ...)
- func CalcFloatDistance(dim int64, left, right []float32, metric string) ([]float32, error)
- func CosineImplPure(a []float32, b []float32) float32
- func IPImplPure(a []float32, b []float32) float32
- func L2ImplPure(a []float32, b []float32) float32
- func ValidateFloatArrayLength(dim int64, length int) error
- func ValidateMetricType(metric string) (string, error)
Constants ¶
View Source
const ( // L2 represents the Euclidean distance L2 = "L2" // IP represents the inner product distance IP = "IP" // COSINE represents the cosine distance COSINE = "COSINE" )
*
- Delete in #25663 Remove calc_distance
- Add back partially as clustering feature needs to calculate distance between search vector and clustering center
Variables ¶
View Source
var ( L2Impl func(a []float32, b []float32) float32 = L2ImplPure IPImpl func(a []float32, b []float32) float32 = IPImplPure CosineImpl func(a []float32, b []float32) float32 = CosineImplPure )
Functions ¶
func CalcFFBatch ¶
func CalcFFBatch(dim int64, left []float32, lIndex int64, right []float32, metric string, result *[]float32)
CalcFFBatch calculate the distance of @left & @right vectors in batch by given @metic, store result in @result
func CalcFloatDistance ¶
CalcFloatDistance calculate float distance by given metric it will checks input, and calculate the distance concurrently
func CosineImplPure ¶
func IPImplPure ¶
func L2ImplPure ¶
func ValidateFloatArrayLength ¶
ValidateFloatArrayLength is used validate float vector length
func ValidateMetricType ¶
ValidateMetricType returns metric text or error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.