embedding

package
v0.0.0-...-131b1cd Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyVecor            = errors.New("vectors must not be empty")
	ErrWeightLenghtsMismatch = errors.New("length of weights must match the number of vectors")
	ErrDimensionMismatch     = errors.New("vectors must have the same dimension")
)

Various errors that can heppen during embedding.

Functions

func Batch

func Batch(inputs []string, batch int) [][]string

Batch will split inputs by the batch size.

func CombineBatchedEmbedding

func CombineBatchedEmbedding(vectors [][]float64, weights []float64) ([]float64, error)

CombineBatchedEmbedding combine the batched results into a normalized vector.

Types

This section is empty.

Jump to

Keyboard shortcuts

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