package
module
Version:
v0.0.0-...-3064a60
Opens a new window with list of versions in this module.
Published: Feb 27, 2023
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
hnswlib-to-go
Hnswlib to go. Golang interface to hnswlib(https://github.com/nmslib/hnswlib). This is a golang interface of hnswlib. For more information, please follow hnswlib and Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs..
But in this project, we make compatible hnswlib to 0.7.0.
Version
-
version 1.1.0
- Update hnswlib compatible version to 0.7.0
- Add some apis(AddBatchPoints、SearchBatchKNN、Free、SetNormalize)
-
version 1.0.1
- Code format
- Add an api support unload the graph(Experimental)
-
version 1.0.0
- hnswlib compatible version 0.5.2.
Build
- Linux/MacOS
- Build Golang Env
go mod init
make
Usage
- When building golang program, please add
export CGO_CXXFLAGS=-std=c++11
command before go build / run / test ...
argument |
type |
|
dim |
int |
vector dimension |
M |
int |
seeALGO_PARAMS.md |
efConstruction |
int |
seeALGO_PARAMS.md |
randomSeed |
int |
random seed for hnsw |
maxElements |
int |
max records in data |
spaceType |
str |
|
spaceType |
distance |
ip |
inner product |
cosine |
cosine similarity |
l2 |
l2 |
Documentation
¶
AddBatchPoints add some points on graph
AddPoint add a point on graph
Save save graph node on graph
SearchKNN search points on graph with knn-algorithm
SetEf set ef argument on graph
func (h *HNSW) SetNormalize(isNeedNormalize bool)
Unload TODO Test for release the graph memory
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.