TOROS N2 - lightweight approximate Nearest Neighbor library which runs fast even with large datasets

37

Watch

504

Star

64

Fork

30

Issue

TOROS N2 - lightweight approximate Nearest Neighbor library which runs fast even with large datasets

## kakao/n2

## N2

Lightweight approximate

NearestNeighbor algorithm library written in C++ (with Python/Go bindings).N2 stands for two N's, which comes from 'Approximate

`N`

earest`N`

eighbor Algorithm'.## Why N2 Was Made

Before N2, there has been other great approximate nearest neighbor libraries such as Annoy and NMSLIB. However, each of them had different strengths and weaknesses regarding usability, performance, and etc. So, N2 has been developed aiming to bring the strengths of existing aKNN libraries and supplement their weaknesses.

## Features

## Supported Distance Metrics

p,q)_{i}· q_{i}) / sqrt(sum(p_{i}· p_{i}) · sum(q_{i}· q_{i}))}_{i}- q_{i})^{2}}_{i}· q_{i})N2 supports three distance metrics. For "angular" and "L2",

d(distance) is defined such that the closer the vectors are, the smallerdis. However for "dot",dis defined such that the closer the vectors are, the largerdis. You may be wondering why we defined and implemented "dot" metric asplain dot productand not as(1 - dot product). The rationale for this decision was to allow users to directly interpret thedvalue returned from Hnsw search function as a dot product value.## Quickstart

## Full Documentation

Visit n2.readthedocs.io for full documentation. The documentation site explains the following contents in detail.

## Performance

## Index Build Time

## Search Speed

## Memory Usage

## References

## License

This software is licensed under the Apache 2 license, quoted below.

Copyright 2017 Kakao Corp. http://www.kakaocorp.com

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this project except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.