Documentation
¶
Index ¶
- func Concurrently(n uint64, action Action)
- type Action
- type Centroid
- type DistanceLookUpTable
- type Encoder
- type EncoderDistribution
- type FilterFunc
- type KMeans
- func (m *KMeans) Add(x []float32)
- func (m *KMeans) Center(point []float32) []float32
- func (m *KMeans) Centers() [][]float32
- func (m *KMeans) Centroid(i uint64) []float32
- func (m *KMeans) Encode(point []float32) uint64
- func (m *KMeans) ExposeDataForRestore() []byte
- func (m *KMeans) Fit(data [][]float32) error
- func (m *KMeans) NNearest(point []float32, n int) []uint64
- func (m *KMeans) Nearest(point []float32) uint64
- type KMeansPartitionData
- type PQData
- type PQDistancer
- type PQEncoder
- type ProductQuantizer
- func (pq *ProductQuantizer) CenterAt(vec []float32) *DistanceLookUpTable
- func (pq *ProductQuantizer) Decode(code []byte) []float32
- func (pq *ProductQuantizer) Distance(encoded []byte, lut *DistanceLookUpTable) float32
- func (pq *ProductQuantizer) DistanceBetweenCompressedAndUncompressedVectors(x []float32, encoded []byte) float32
- func (pq *ProductQuantizer) DistanceBetweenCompressedVectors(x, y []byte) float32
- func (pq *ProductQuantizer) Encode(vec []float32) []byte
- func (pq *ProductQuantizer) ExposeFields() PQData
- func (pq *ProductQuantizer) Fit(data [][]float32)
- func (pq *ProductQuantizer) NewDistancer(a []float32) *PQDistancer
- type TileEncoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Concurrently ¶
Types ¶
type DistanceLookUpTable ¶
type DistanceLookUpTable struct {
// contains filtered or unexported fields
}
func NewDistanceLookUpTable ¶
func NewDistanceLookUpTable(segments int, centroids int, center []float32) *DistanceLookUpTable
func (*DistanceLookUpTable) LookUp ¶
func (lut *DistanceLookUpTable) LookUp( encoded []byte, pq *ProductQuantizer, ) float32
type EncoderDistribution ¶
type EncoderDistribution byte
const ( NormalEncoderDistribution EncoderDistribution = 0 LogNormalEncoderDistribution EncoderDistribution = 1 )
type FilterFunc ¶
type KMeans ¶
type KMeans struct { K int // How many centroids DeltaThreshold float32 // Used to stop fitting if there are not too much changes in the centroids anymore IterationThreshold int // Used to stop fitting after a certain amount of iterations Distance distancer.Provider // contains filtered or unexported fields }
func NewKMeansWithCenters ¶
func (*KMeans) ExposeDataForRestore ¶
type KMeansPartitionData ¶
type KMeansPartitionData struct {
// contains filtered or unexported fields
}
type PQDistancer ¶
type PQDistancer struct {
// contains filtered or unexported fields
}
type ProductQuantizer ¶
type ProductQuantizer struct { ExtractCode func(encoded []byte, index int) uint64 PutCode func(code uint64, encoded []byte, index int) // contains filtered or unexported fields }
func NewProductQuantizer ¶
func NewProductQuantizer(segments int, centroids int, useBitsEncoding bool, distance distancer.Provider, dimensions int, encoderType Encoder, encoderDistribution EncoderDistribution) (*ProductQuantizer, error)
ToDo: Add a settings struct. Already necessary!!
func (*ProductQuantizer) CenterAt ¶
func (pq *ProductQuantizer) CenterAt(vec []float32) *DistanceLookUpTable
func (*ProductQuantizer) Decode ¶
func (pq *ProductQuantizer) Decode(code []byte) []float32
func (*ProductQuantizer) Distance ¶
func (pq *ProductQuantizer) Distance(encoded []byte, lut *DistanceLookUpTable) float32
func (*ProductQuantizer) DistanceBetweenCompressedAndUncompressedVectors ¶
func (pq *ProductQuantizer) DistanceBetweenCompressedAndUncompressedVectors(x []float32, encoded []byte) float32
func (*ProductQuantizer) DistanceBetweenCompressedVectors ¶
func (pq *ProductQuantizer) DistanceBetweenCompressedVectors(x, y []byte) float32
func (*ProductQuantizer) Encode ¶
func (pq *ProductQuantizer) Encode(vec []float32) []byte
func (*ProductQuantizer) ExposeFields ¶
func (pq *ProductQuantizer) ExposeFields() PQData
func (*ProductQuantizer) Fit ¶
func (pq *ProductQuantizer) Fit(data [][]float32)
func (*ProductQuantizer) NewDistancer ¶
func (pq *ProductQuantizer) NewDistancer(a []float32) *PQDistancer
type TileEncoder ¶
type TileEncoder struct {
// contains filtered or unexported fields
}
func NewTileEncoder ¶
func NewTileEncoder(bits int, segment int, encoderDistribution EncoderDistribution) *TileEncoder
func RestoreTileEncoder ¶
func (*TileEncoder) Add ¶
func (te *TileEncoder) Add(x []float32)
func (*TileEncoder) Centroid ¶
func (te *TileEncoder) Centroid(b uint64) []float32
func (*TileEncoder) Encode ¶
func (te *TileEncoder) Encode(x []float32) uint64
func (*TileEncoder) ExposeDataForRestore ¶
func (te *TileEncoder) ExposeDataForRestore() []byte
func (*TileEncoder) Fit ¶
func (te *TileEncoder) Fit(data [][]float32) error
Click to show internal directories.
Click to hide internal directories.