Skip to content

Commit 30fa646

Browse files
author
Ubuntu
committed
Misc updates for run
1 parent 33ecd5f commit 30fa646

File tree

17 files changed

+39
-40
lines changed

17 files changed

+39
-40
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ The only prerequisite is Python (tested with 3.10.6) and Docker.
124124
Running
125125
=======
126126

127-
1. Run `python run.py` (this can take an extremely long time, potentially days)
128-
2. Run `python plot.py` or `python create_website.py` to plot results.
129-
3. Run `python data_export.py --out res.csv` to export all results into a csv file for additional post-processing.
127+
1. Run `python run.py` (this can take an extremely long time, potentially days).
128+
2. Run `python plot.py --x-scale logit --y-scale log` to plot results.
129+
3. Run `python create_website.py` to create a website with lots of plots.
130130

131131
You can customize the algorithms and datasets as follows:
132132

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
FROM ubuntu:22.04
22

33
RUN apt-get update
4-
RUN apt-get install -y python3-numpy python3-scipy python3-pip build-essential git
5-
RUN pip3 install -U pip
6-
RUN python3 --version | grep 'Python 3.10'
4+
RUN apt-get install -y python3-pip python-is-python3 build-essential git
5+
RUN python --version | grep 'Python 3.10'
76

87
WORKDIR /home/app
98
COPY requirements.txt run_algorithm.py ./
10-
RUN pip3 install -r requirements.txt
9+
RUN pip install -r requirements.txt
1110

12-
ENTRYPOINT ["python3", "-u", "run_algorithm.py"]
11+
ENTRYPOINT ["python", "-u", "run_algorithm.py"]
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
FROM ann-benchmarks
22

3-
RUN apt-get install -y python-setuptools python-pip
4-
RUN pip3 install pybind11 numpy setuptools
5-
RUN git clone https://github.com/nmslib/hnsw.git;cd hnsw; git checkout denorm
3+
RUN pip install pybind11 numpy setuptools
4+
RUN git clone https://github.com/nmslib/hnsw.git; cd hnsw; git checkout denorm
65

76
RUN cd hnsw/python_bindings; python3 setup.py install
87

9-
RUN python3 -c 'import hnswlib'
8+
RUN python -c 'import hnswlib'
109

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ann-benchmarks
22

3-
RUN apt-get update && apt-get install -y libboost-timer-dev libboost-chrono-dev libboost-program-options-dev libboost-system-dev libboost-python-dev
3+
RUN apt-get update && apt-get install -y libboost-timer-dev libboost-chrono-dev libboost-program-options-dev libboost-system-dev libboost-python-dev libopenblas-dev
44
RUN git clone https://github.com/aaalgo/kgraph
5-
RUN cd kgraph && python3 setup.py build && python3 setup.py install
6-
RUN python3 -c 'import pykgraph'
5+
RUN cd kgraph && pip install -e .
6+
RUN python -c 'import kgraph'

ann_benchmarks/algorithms/kgraph/module.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22

33
import numpy
4-
import pykgraph
4+
import kgraph
55

66
from ...constants import INDEX_DIR
77
from ..base.module import BaseANN
@@ -18,7 +18,7 @@ def __init__(self, metric, index_params, save_index):
1818
def fit(self, X):
1919
if X.dtype != numpy.float32:
2020
X = X.astype(numpy.float32)
21-
self._kgraph = pykgraph.KGraph(X, self._metric)
21+
self._kgraph = kgraph.KGraph(X, self._metric)
2222
path = os.path.join(INDEX_DIR, "kgraph-index-%s" % self._metric)
2323
if os.path.exists(path):
2424
self._kgraph.load(path)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM ann-benchmarks
22

3-
RUN apt-get install -y libhdf5-openmpi-dev cython
4-
RUN pip3 install nearpy bitarray redis sklearn
5-
RUN python3 -c 'import nearpy'
3+
RUN apt-get install -y libhdf5-openmpi-dev cython3
4+
RUN pip install nearpy bitarray redis
5+
RUN python -c 'import nearpy'
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ann-benchmarks
22

3-
RUN pip3 install pypandoc==1.4
3+
RUN pip install pypandoc==1.4 pybind11
44
RUN git clone https://github.com/puffinn/puffinn
5-
RUN cd puffinn && python3 setup.py install
6-
RUN python3 -c 'import puffinn'
5+
RUN cd puffinn && python setup.py install
6+
RUN python -c 'import puffinn'
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM ann-benchmarks
22

3-
RUN pip3 install vearch==3.2.8.3
4-
RUN python3 -c 'import vearch'
3+
RUN pip install 'numpy<2'
4+
RUN pip install vearch==3.2.8.3
5+
RUN python -c 'import vearch'
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM ann-benchmarks
22

3-
RUN apt-get install -y python-setuptools python-pip
4-
RUN pip3 install voyager
3+
RUN apt-get install -y python-setuptools
4+
RUN pip install voyager
55

6-
RUN python3 -c 'import voyager'
6+
RUN python -c 'import voyager'
77

plot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def inv_fun(x):
8888
# Workaround for bug https://github.com/matplotlib/matplotlib/issues/6789
8989
ax.spines["bottom"]._adjust_location()
9090

91-
plt.savefig(fn_out, bbox_inches="tight")
91+
plt.savefig(fn_out, bbox_inches="tight", dpi=144)
9292
plt.close()
9393

9494

@@ -108,7 +108,7 @@ def inv_fun(x):
108108
"-y", "--y-axis", help="Which metric to use on the Y-axis", choices=metrics.keys(), default="qps"
109109
)
110110
parser.add_argument(
111-
"-X", "--x-scale", help="Scale to use when drawing the X-axis. Typically linear, logit or a2", default="linear"
111+
"-X", "--x-scale", help="Scale to use when drawing the X-axis. Typically linear, logit or a2", default="linear",
112112
)
113113
parser.add_argument(
114114
"-Y",

requirements.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
ansicolors==1.1.8
22
docker==7.1.0
3-
h5py==3.8.0
4-
matplotlib==3.6.3
5-
numpy==1.24.2
6-
pyyaml==6.0
7-
psutil==5.9.4
8-
scikit-learn==1.2.1
9-
jinja2==3.1.2
10-
pytest==7.2.2
11-
datasets==2.12.0
12-
requests==2.31.0
3+
h5py==3.13.0
4+
matplotlib==3.10.1
5+
numpy==2.2.4
6+
pyyaml==6.0.2
7+
psutil==7.0.0
8+
scikit-learn==1.6.1
9+
jinja2==3.1.6
10+
pytest==8.3.5
11+
datasets==3.4.0
12+
requests==2.32.3
131 KB
Loading

results/gist-960-euclidean.png

132 KB
Loading

results/glove-100-angular.png

94 KB
Loading

results/glove-25-angular.png

141 KB
Loading

results/nytimes-256-angular.png

42.4 KB
Loading

results/sift-128-euclidean.png

111 KB
Loading

0 commit comments

Comments
 (0)