sq

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScalarQuantizer

type ScalarQuantizer struct {
	// contains filtered or unexported fields
}

ScalarQuantizer 标量量化器

func NewScalarQuantizer

func NewScalarQuantizer(dimension, bits int) *ScalarQuantizer

NewScalarQuantizer 创建标量量化器

func Quantize

func Quantize(vectors [][]float32, bits int) (*ScalarQuantizer, error)

Quantize 量化向量

func (*ScalarQuantizer) Decode

func (sq *ScalarQuantizer) Decode(encoded []byte) []float32

Decode 解码向量

func (*ScalarQuantizer) Encode

func (sq *ScalarQuantizer) Encode(vector []float32) []byte

Encode 编码向量

func (*ScalarQuantizer) Train

func (sq *ScalarQuantizer) Train(vectors [][]float32) error

Train 训练量化器

Jump to

Keyboard shortcuts

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