vectorutil

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgMax

func ArgMax(s []float32) (int, float32, error)

ArgMax find both index of max value in s and max value.

func Mean

func Mean(vector []float32) float32

Mean of a float32 vector.

func Norm

func Norm(v []float32, p int) float64

Norm of a vector.

func Normalize

func Normalize(embedding []float32, p int) []float32

Normalize single vector according to: https://pytorch.org/docs/stable/generated/torch.nn.functional.normalize.html

func Sigmoid

func Sigmoid(s []float32) []float32

func SoftMax

func SoftMax(vector []float32) []float32

SoftMax take a vector and calculate softmax scores of its values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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