horapy
1.0.0
[홈페이지] [문서] [예시] [호라]
Hora Approximate Nearest Neighbor Search
위한 Python 바인딩
성능 ⚡️
다중 인덱스 지원
Hierarchical Navigable Small World Graph Index(HNSWIndex)
(세부 사항)Satellite System Graph (SSGIndex)
(세부정보)Product Quantization Inverted File(PQIVFIndex)
(세부사항)Random Projection Tree(RPTIndex)
(LSH, WIP)BruteForce (BruteForceIndex)
(SIMD를 사용한 순진한 구현)가지고 다닐 수 있는
no_std
지원(WIP, 부분)Windows
, Linux
및 OS X
지원IOS
및 Android
지원(WIP)BLAS
와 같은 과도한 의존성 없음신뢰할 수 있음
Rust
컴파일러는 모든 코드를 보호합니다.Rust
가 관리하는 메모리다중 거리 지원 ?
Dot Product Distance
Euclidean Distance
Manhattan Distance
Cosine Similarity
생기게 하는
by aws t2.medium (CPU: Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz)
추가 정보
pip install horapy
import numpy as np
from horapy import HNSWIndex
dimension = 50
n = 1000
# init index instance
index = HNSWIndex ( dimension , "usize" )
samples = np . float32 ( np . random . rand ( n , dimension ))
for i in range ( 0 , len ( samples )):
# add node
index . add ( np . float32 ( samples [ i ]), i )
index . build ( "euclidean" ) # build index
target = np . random . randint ( 0 , n )
# 410 in Hora ANNIndex <HNSWIndexUsize> (dimension: 50, dtype: usize, max_item: 1000000, n_neigh: 32, n_neigh0: 64, ef_build: 20, ef_search: 500, has_deletion: False)
# has neighbors: [410, 736, 65, 36, 631, 83, 111, 254, 990, 161]
print ( "{} in {} n has neighbors: {}" . format (
target , index , index . search ( samples [ target ], 10 ))) # search
전체 저장소는 Apache 라이센스를 따릅니다.