metric

package
v0.0.104 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CosineDistance

func CosineDistance(a, b []float32) (float32, error)

CosineDistance calculates the cosine distance between two float32 slices.

func CosineSimilarity

func CosineSimilarity(v1, v2 []float32) (float32, error)

CosineSimilarity calculates the cosine similarity between two float32 slices.

func Magnitude

func Magnitude(v []float32) float32

Magnitude calculates the magnitude (length) of a float32 slice.

func SquaredL2 added in v0.0.104

func SquaredL2(v1, v2 []float32) (float32, error)

SquaredL2 calculates the squared L2 distance between two float32 slices.

Types

This section is empty.

Jump to

Keyboard shortcuts

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