hora wasm
1.0.0
[홈페이지] [문서] [예시] [호라]
WebAssembly 방식으로 Hora Approximate Nearest Neighbor Search
위한 Javascript 입찰입니다.
성능 ⚡️
다중 인덱스 지원
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를 사용한 순진한 구현)신뢰할 수 있음
Rust
컴파일러는 모든 코드를 보호합니다.Python lib
와 같은 모든 언어 라이브러리에 대해 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)
추가 정보
npm i horajs
import * as horajs from "horajs" ;
const demo = ( ) => {
const dimension = 50 ;
var bf_idx = horajs . BruteForceIndexUsize . new ( dimension ) ;
// var hnsw_idx = horajs.HNSWIndexUsize.new(dimension, 1000000, 32, 64, 20, 500, 16, false);
for ( var i = 0 ; i < 1000 ; i ++ ) {
var feature = [ ] ;
for ( var j = 0 ; j < dimension ; j ++ ) {
feature . push ( Math . random ( ) ) ;
}
bf_idx . add ( feature , i ) ; // add point
}
bf_idx . build ( "euclidean" ) ; // build index
var feature = [ ] ;
for ( var j = 0 ; j < dimension ; j ++ ) {
feature . push ( Math . random ( ) ) ;
}
console . log ( "bf result" , bf_idx . search ( feature , 10 ) ) ; //bf result Uint32Array(10) [704, 113, 358, 835, 408, 379, 117, 414, 808, 826]
}
( async ( ) => {
await horajs . default ( ) ;
await horajs . init_env ( ) ;
demo ( ) ;
} ) ( ) ;
전체 저장소는 Apache 라이센스를 따릅니다.