Doing fast searching of nearest neighbors in high dimensional spaces is an increasingly important problem, but so far there has not been a lot of empirical attempts at comparing approaches in an objective way.
This project contains some tools to benchmark various implementations of approximate nearest neighbor (ANN) search for different metrics. We have pregenerated datasets (in HDF5) formats and we also have Docker containers for each algorithm. There's a test suite that makes sure every algorithm works.
We have a number of precomputed data sets for this. All data sets are pre-split into train/test and come with ground truth data in the form of the top 100 neighbors. We store them in a HDF5 format:
Dataset | Dimensions | Train size | Test size | Neighbors | Distance | Download |
---|---|---|---|---|---|---|
DEEP1B | 96 | 9,990,000 | 10,000 | 100 | Angular | HDF5 (3.6GB) |
Fashion-MNIST | 784 | 60,000 | 10,000 | 100 | Euclidean | HDF5 (217MB) |
GIST | 960 | 1,000,000 | 1,000 | 100 | Euclidean | HDF5 (3.6GB) |
GloVe | 25 | 1,183,514 | 10,000 | 100 | Angular | HDF5 (121MB) |
GloVe | 50 | 1,183,514 | 10,000 | 100 | Angular | HDF5 (235MB) |
GloVe | 100 | 1,183,514 | 10,000 | 100 | Angular | HDF5 (463MB) |
GloVe | 200 | 1,183,514 | 10,000 | 100 | Angular | HDF5 (918MB) |
Kosarak | 27983 | 74,962 | 500 | 100 | Jaccard | HDF5 (2.0GB) |
MNIST | 784 | 60,000 | 10,000 | 100 | Euclidean | HDF5 (217MB) |
NYTimes | 256 | 290,000 | 10,000 | 100 | Angular | HDF5 (301MB) |
SIFT | 128 | 1,000,000 | 10,000 | 100 | Euclidean | HDF5 (501MB) |
These are all as of 2019-06-10, running all benchmarks on a c5.4xlarge machine on AWS:
The only prerequisite is Python (tested with 3.6) and Docker.
pip install -r requirements.txt
.python install.py
to build all the libraries inside Docker containers (this can take a while, like 10-30 minutes).python run.py
(this can take an extremely long time, potentially days)python plot.py
or python create_website.py
to plot results.You can customize the algorithms and datasets if you want to:
algos.yaml
contains the parameter settings that you want to testpython run.py --dataset glove-100-angular
. See python run.py --help
for more information on possible settings. Note that experiments can take a long time.python plot.py --dataset glove-100-angular
or python create_website.py
. An example call: python create_website.py --plottype recall/time --latex --scatter --outputdir website/
.ann_benchmarks/algorithms
by providing a small Python wrapper.install/
for italgos.yaml
.travis.yml
--batch
to run.py
and plot.py
to enable batch mode.--local --batch
.Built by Erik Bernhardsson with significant contributions from Martin Aumüller and Alexander Faithfull.
The following publication details design principles behind the benchmarking framework:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。