Documentation ¶
Index ¶
- Variables
- func AngularToCosineDist(angular float64) float64
- func ConvertTo64(ar []float32) []float64
- func ConvertToInt(ar []int32) []int
- func CosineDistToAngular(cosine float64) float64
- func GetMeanStdSampled(data [][]float64, sampleSize int) ([]float64, []float64, error)
- func GetMeanStdSampledRecords(vecs [][]float64, sampleSize int) ([]float64, []float64, error)
- func NewVec(data []float64) blas64.Vector
- type Angular
- type Config
- type Hasher
- type HasherConfig
- type IndexConfig
- type Indexer
- type L2
- type LSHIndex
- type Metric
- type Neighbor
- type NeighborMinHeap
- type StandartScaler
- type StringSet
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DistanceErr = errors.New("Distance can't be calculated")
)
Functions ¶
func AngularToCosineDist ¶
func CosineDistToAngular ¶
func GetMeanStdSampled ¶
GetMeanStd returns mean and std based on incoming NxM matrix
func GetMeanStdSampledRecords ¶
GetMeanStdSampledRecords duplucate of GetMeanStdSample but for the Record data type, must be refactored later
Types ¶
type Angular ¶
type Angular bool
Angular calculates cosine distance between two given vectors
func NewAngular ¶
func NewAngular() Angular
type Config ¶
type Config struct { IndexConfig HasherConfig }
Config holds all needed constants for creating the Hasher instance
type Hasher ¶
type Hasher struct { Config HasherConfig // contains filtered or unexported fields }
Hasher holds N_PERMUTS number of trees
func NewHasher ¶
func NewHasher(config HasherConfig) *Hasher
type HasherConfig ¶
type IndexConfig ¶
type IndexConfig struct { BatchSize int MaxCandidates int // contains filtered or unexported fields }
IndexConfig ...
type Indexer ¶
type Indexer interface { Train(vecs [][]float64, ids []string) error Search(query []float64, maxNN int, distanceThrsh float64) ([]Neighbor, error) }
Indexer holds implementation of NN search index
type LSHIndex ¶
type LSHIndex struct {
// contains filtered or unexported fields
}
LSHIndex holds buckets with vectors and hasher instance
func (*LSHIndex) DumpHasher ¶
DumpHasher serializes hasher
func (*LSHIndex) LoadHasher ¶
LoadHasher fills hasher from byte array
type NeighborMinHeap ¶
type NeighborMinHeap []*Neighbor
func (NeighborMinHeap) Len ¶
func (h NeighborMinHeap) Len() int
func (NeighborMinHeap) Less ¶
func (h NeighborMinHeap) Less(i, j int) bool
func (*NeighborMinHeap) Pop ¶
func (h *NeighborMinHeap) Pop() interface{}
func (*NeighborMinHeap) Push ¶
func (h *NeighborMinHeap) Push(x interface{})
func (NeighborMinHeap) Swap ¶
func (h NeighborMinHeap) Swap(i, j int)
type StandartScaler ¶
StandartScaler ...
func NewStandartScaler ¶
func NewStandartScaler(mean, std []float64, nDims int) *StandartScaler
type StringSet ¶
func NewStringSet ¶
func NewStringSet() *StringSet
Click to show internal directories.
Click to hide internal directories.