Skip to content
This repository was archived by the owner on Nov 21, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
5e09b76
paper-icde: ICDE 2027 workspace — IEEEtran skeleton, restored design …
tae898 Jul 6, 2026
ca88718
paper-icde: benchmark protocol — parent-cgroup resource equality, sum…
tae898 Jul 6, 2026
6eae737
paper-icde: revised experiment matrix — per-model lanes + unification…
tae898 Jul 6, 2026
7ea61a0
paper-icde: lane baselines — server+embedded specialist pairs (Ladybu…
tae898 Jul 6, 2026
a9ed77b
paper-icde: workload protocol — separate OLTP/OLAP suites, idiomatic …
tae898 Jul 6, 2026
ea0e6d3
paper-icde: protocol impl note — shared cpuset + explicit memory spli…
tae898 Jul 6, 2026
9c46fc2
paper-icde: protocol — explicit 12-thread P-core allocation + engine …
tae898 Jul 6, 2026
d19fb0d
paper-icde: protocol — build-once-query-many, co-scheduling decided b…
tae898 Jul 6, 2026
b513402
paper: author email taewoon@humem.ai
tae898 Jul 6, 2026
ae6f6e8
paper-icde: protocol — mini is the exclusive bench host (cypherglot o…
tae898 Jul 6, 2026
fc42d3c
paper-icde: L1 harness green 8/8 — runner + tabular lane, four backends
tae898 Jul 6, 2026
d83a989
paper-icde: cite Himpe's DatAasee (arXiv:2409.05512) as academic adop…
tae898 Jul 7, 2026
21ccd69
paper-icde: protocol — defaults-first config policy with fairness ove…
tae898 Jul 7, 2026
ca84eda
paper-icde: L3 sparse lane green through 1M — 5 backends, exact GT, r…
tae898 Jul 7, 2026
1738729
paper-icde: L3 — ArcadeDB embedded settle step via blocking LSM compact
tae898 Jul 7, 2026
d19d156
paper-icde: rebuild paper.pdf (DatAasee cite)
tae898 Jul 7, 2026
c139484
paper-icde: L3 — embedded ingest via native document API (1.8x)
tae898 Jul 7, 2026
4c354f8
paper-icde: L3 sparse 10M results from mini — first paper-scale campaign
tae898 Jul 7, 2026
c05b494
paper-icde: heap parity for ArcadeDB server containers (user-caught f…
tae898 Jul 7, 2026
2f1c6a0
paper-icde: L3 10M ArcadeDB server re-measured with heap parity
tae898 Jul 7, 2026
4b54b72
paper-icde: embedded/server JVM parity — -Xms pinned both sides, pari…
tae898 Jul 7, 2026
0afba8f
paper-icde: L3 10M embedded re-measured with pinned -Xms — parity pai…
tae898 Jul 7, 2026
afc3077
paper-icde: sweep-tier scheduler — parallel workers on disjoint cpuse…
tae898 Jul 7, 2026
4a15258
paper-icde: L2 graph lane green at micro+tiny — 4 backends, OLTP+OLAP…
tae898 Jul 7, 2026
63b78bf
paper-icde: L3 sparse N=5 campaign complete — 75/75 green (tiny/small…
tae898 Jul 7, 2026
9be5479
paper-icde: L2 graph N=5 campaign complete — 120/120 green (tiny/smal…
tae898 Jul 8, 2026
9ee66b9
paper-icde: summarizer — runs.jsonl -> paper-ready mean±std tables
tae898 Jul 8, 2026
8d716a2
paper-icde: fix postgres readiness race (initdb double-ready) + conne…
tae898 Jul 8, 2026
b8de0c7
Merge branch 'main' into icde-2027
tae898 Jul 8, 2026
48a9240
paper-icde: figures pipeline — first paper figure (L3 sparse scale sw…
tae898 Jul 8, 2026
82a6652
paper-icde: L3d dense generator — 1024-dim unit vectors (#3144 shape)…
tae898 Jul 8, 2026
b7b5dba
Merge branch 'main' into icde-2027
tae898 Jul 8, 2026
ee4338e
paper-icde: Background OrientDB lessons (Garulli) + Roberto author bl…
tae898 Jul 8, 2026
42f7e23
paper-icde: remove all em dashes from paper.tex prose + todos (human …
tae898 Jul 8, 2026
3cc0941
paper-icde: pin benchmarks to arcadedb-embedded==26.7.2 (final) + FP3…
tae898 Jul 9, 2026
12bad41
paper-icde: enforce one-runner-per-host with an flock guard
tae898 Jul 9, 2026
1ccfec0
paper-icde: protocol — sparse quantization is now selectable (#5143);…
tae898 Jul 9, 2026
fc00387
paper-icde: FIX broken adapter class structure; add nocompact ablatio…
tae898 Jul 9, 2026
394a41b
paper-icde: Christian to acknowledgements (his choice); author block …
tae898 Jul 9, 2026
77f76bb
paper-icde: fail fast on adapter exceptions instead of idling to the …
tae898 Jul 9, 2026
d7632fd
paper-icde: pin every image by digest and every client lib by version
tae898 Jul 10, 2026
a759f3d
paper-icde: use the official ladybug 0.18.1 package; align Elasticsea…
tae898 Jul 10, 2026
8a583e4
paper-icde: 26.8.1 re-campaign — memory anon working set, server COMP…
tae898 Jul 10, 2026
736bf89
paper-icde: server adapter reports the real engine version, not 'serv…
tae898 Jul 10, 2026
41a7604
paper-icde: raise queryMaxHeapElementsAllowedPerOp for L1 OLAP (fairn…
tae898 Jul 12, 2026
76a7019
paper-icde: real Big-ANN SPLADE/MS MARCO source for the sparse lane
tae898 Jul 12, 2026
d926a02
paper-icde: cap Big-ANN sparse queries at 1000 (stable percentiles, b…
tae898 Jul 12, 2026
7fbd702
paper-icde: report median [min-max] not mean±std (DBTest fair-benchma…
tae898 Jul 12, 2026
1b7cff9
paper-icde: summarize accepts sweep(parallel) tier, not just paper(se…
tae898 Jul 12, 2026
cc8d9c0
paper-icde: L3d dense lane on SIFT1M (ann-benchmarks, exact L2 GT)
tae898 Jul 12, 2026
419aae2
paper-icde: results checkpoint (definitive synthetic campaign + lapto…
tae898 Jul 12, 2026
9157a23
paper-icde: regenerate sparse scale-sweep figure
tae898 Jul 12, 2026
79b5902
paper-icde: re-pin to post-#5254 engine (dev1 wheel + fresh SNAPSHOT …
tae898 Jul 12, 2026
a99db3d
paper-icde: l3d arcadedb_dense_server backend (deployment axis for de…
tae898 Jul 12, 2026
27325f3
paper-icde: record pip package version (dev-release-aware), not pom-d…
tae898 Jul 13, 2026
6dac239
paper-icde: runner --only-reps for surgical per-rep re-runs
tae898 Jul 15, 2026
a3e9806
paper-icde: pin 26.8.1.dev2 wheel + post-#5306/#5307 server digest fo…
tae898 Jul 17, 2026
2f676b4
paper-icde: pin arcadedb-embedded 26.8.1.dev3 (post-#5318) for upcomi…
tae898 Jul 18, 2026
4a4258a
paper-icde: LDBC-SNB data source for the L2 graph lane
tae898 Jul 18, 2026
71edcfe
paper-icde: l2 embedded adapter keys vertices by id (LDBC sparse ids)
tae898 Jul 18, 2026
5b9b50d
paper-icde: runner sf1/sf10 scales + BENCH_GRAPH_* env forwarding for…
tae898 Jul 18, 2026
42b23f6
paper-icde: l2 server adapter escapes SQL string literals; ladybug CS…
tae898 Jul 18, 2026
7e874c6
paper-icde: sf1/sf10 heaps sized to fit the 75% server-container memo…
tae898 Jul 18, 2026
d30227d
paper-icde: untrack raw results (runs.jsonl, per-campaign CSVs)
tae898 Jul 18, 2026
9187452
paper-icde: DuckDB-VSS ingest via Arrow bulk path (fairness fix)
tae898 Jul 18, 2026
ab9564e
paper-icde: record phase-at-timeout evidence in timeout rows
tae898 Jul 18, 2026
7848d58
paper-icde: DEEP-10M dense tier (deep-image-96-angular, unit-normaliz…
tae898 Jul 18, 2026
5aa3710
paper-icde: deep10m loader uses writable copy for normalization
tae898 Jul 18, 2026
e1e164f
paper-icde: results-integrity fixes + deep10m heap
tae898 Jul 18, 2026
047f6db
paper-icde: deep10m envelope 24g->28g (client share must hold the 3.8…
tae898 Jul 18, 2026
555fbd8
paper-icde: chunked deep10m loader (transient copy+cache peak OOM-kil…
tae898 Jul 19, 2026
d2c6348
paper-icde: deep10m chunk copy must be np.array (asarray on float32 m…
tae898 Jul 19, 2026
79c01c2
paper-icde: arcadedb server index-build HTTP timeout 30min->6h (synch…
tae898 Jul 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -564,3 +564,5 @@ notes.txt
/server/profiler
/server/chats
config/ai.json
paper-icde/experiments/results/runs.jsonl
paper-icde/experiments/results/runs-*.csv
15 changes: 15 additions & 0 deletions paper-icde/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# LaTeX build artifacts (keep paper.pdf committed for co-author convenience)
latex/*.aux
latex/*.bbl
latex/*.blg
latex/*.log
latex/*.out
latex/*.fls
latex/*.fdb_latexmk
latex/*.synctex.gz
# Raw benchmark outputs (summaries are committed)
results/raw/
experiments/**/__pycache__/
results/*.json
results/*.jsonl
results/*.csv
18 changes: 18 additions & 0 deletions paper-icde/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ArcadeDB DB-engine paper (ICDE 2027 Industry & Applications track)

Working branch `icde-2027` — **never merged to `main`**. Holds the paper LaTeX,
the benchmark harness, and committed result summaries for the ArcadeDB
multi-model engine paper (Kim, Franchini, Himpe, Garulli).

- `latex/` — IEEEtran source; build with `latexmk -pdf paper.tex`.
- `experiments/` — DB-vs-DB benchmark harness (docker, pinned digests,
identical cpuset/memory caps, N=5 mean±std; every reported number from
serial re-runs). Raw results are gitignored; summaries are committed.
- `design-docs/` — reference copies of engine design docs restored from git
history (`40bc98c843`), kept verbatim as paper source material.
- Paper strategy / venue notes / rebuttals live OUTSIDE this repo (private).

Thesis (evidence-audited): multi-model unification over one page/WAL/MVCC
transaction pipeline — documents, graph, KV, time series, and vectors, with
every index type committing in the same transaction and Raft replicating
model-agnostic WAL page diffs. No individual mechanism is claimed as novel.
926 changes: 926 additions & 0 deletions paper-icde/design-docs/arcadedb-vs-leading-vector-dbms.md

Large diffs are not rendered by default.

822 changes: 822 additions & 0 deletions paper-icde/design-docs/sparse-vector-storage-design.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions paper-icde/experiments/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data/
__pycache__/

# runner lock (host-local, never committed)
results/.runner.lock
19 changes: 19 additions & 0 deletions paper-icde/experiments/Dockerfile.bench
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generic benchmark image. Pin the package set via build ARG so each backend
# (arcadedb, duckdb, ladybug, chroma, faiss, ...) gets its own pinned image later.
# arcadedb-embedded bundles its own JRE, so no Java install is needed.
FROM python:3.12-slim

ARG PIP_PACKAGES=""
# Local wheels (e.g. a not-yet-released arcadedb-embedded) placed in
# docker/wheels/ are installed first; the dir ships empty (.gitkeep).
COPY docker-wheels/ /tmp/wheels/
RUN set -e; \
if ls /tmp/wheels/*.whl >/dev/null 2>&1; then \
pip install --no-cache-dir /tmp/wheels/*.whl; \
fi; \
if [ -n "${PIP_PACKAGES}" ]; then pip install --no-cache-dir ${PIP_PACKAGES}; fi; \
rm -rf /tmp/wheels

WORKDIR /work
# Scripts are mounted at run time (-v) so we can iterate without rebuilding.
CMD ["python", "--version"]
275 changes: 275 additions & 0 deletions paper-icde/experiments/PROTOCOL.md

Large diffs are not rendered by default.

83 changes: 83 additions & 0 deletions paper-icde/experiments/bench_common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/usr/bin/env python3
"""Shared metrics helpers for the benchmark lanes.

Stdlib-only (so every backend image can import it): latency summary stats,
on-disk size, a raw-latency sidecar dump, and a small timing context manager.
"""
import json
import os
import statistics as st
import time


def _pct(sorted_a, p):
"""Linear-interpolation percentile (numpy-compatible), pure-python."""
n = len(sorted_a)
if n == 1:
return sorted_a[0]
rank = (p / 100.0) * (n - 1)
lo = int(rank)
hi = min(lo + 1, n - 1)
frac = rank - lo
return sorted_a[lo] * (1 - frac) + sorted_a[hi] * frac


def latstats(prefix, arr_ms):
"""Full latency summary (ms) for a list of per-op latencies:
n, mean, std, min, p50, p90, p95, p99, max."""
if not arr_ms:
return {}
a = sorted(float(x) for x in arr_ms)
n = len(a)
return {
f"{prefix}_n": n,
f"{prefix}_mean_ms": round(st.mean(a), 4),
f"{prefix}_std_ms": round(st.pstdev(a) if n > 1 else 0.0, 4),
f"{prefix}_min_ms": round(a[0], 4),
f"{prefix}_p50_ms": round(_pct(a, 50), 4),
f"{prefix}_p90_ms": round(_pct(a, 90), 4),
f"{prefix}_p95_ms": round(_pct(a, 95), 4),
f"{prefix}_p99_ms": round(_pct(a, 99), 4),
f"{prefix}_max_ms": round(a[-1], 4),
}


def dir_size_mb(path):
"""On-disk size of a file or directory tree (MiB)."""
if not path or not os.path.exists(path):
return None
if os.path.isfile(path):
total = os.path.getsize(path)
else:
total = 0
for root, _, files in os.walk(path):
for f in files:
try:
total += os.path.getsize(os.path.join(root, f))
except OSError:
pass
return round(total / 1048576.0, 3)


def dump_latencies(run_label, lat_by_op):
"""Write raw per-op latency arrays to $LAT_DIR/<label>.json (set by run.py).
No-op if LAT_DIR is unset. Returns the relative sidecar path or None."""
d = os.environ.get("LAT_DIR")
if not d or not run_label:
return None
os.makedirs(d, exist_ok=True)
with open(os.path.join(d, f"{run_label}.json"), "w") as f:
json.dump({k: [round(float(x), 5) for x in v] for k, v in lat_by_op.items() if v}, f)
return f"lat/{run_label}.json"


class timed:
"""`with timed() as t: ...` then read t.s (elapsed seconds)."""
def __enter__(self):
self._t0 = time.time()
self.s = 0.0
return self

def __exit__(self, *exc):
self.s = time.time() - self._t0
return False
97 changes: 97 additions & 0 deletions paper-icde/experiments/bigann_sparse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
"""Real learned-sparse corpus for the L3 sparse lane: Big-ANN 2023 Sparse track
(SPLADE-cocondenser encoding of MS MARCO passages v1), with the challenge's exact
top-k MIPS ground truth.

Drop-in replacement for sparse_common: same DIMENSIONS/K/SCALE_DOCS/SCALE_QUERIES/
gen_docs/gen_queries surface, but streams vectors from the shipped CSR files
instead of generating a synthetic corpus. Selected in l3_sparse via
BENCH_SPARSE_SOURCE=bigann.

Data files (BENCH_SPARSE_DATA, default /data/bigann), fetched from
gs://ann-challenge-sparse-vectors/csr/:
base_small.csr (100k) / base_1M.csr (1M) / base_full.csr (8.84M)
queries.dev.csr (6980 queries, shared across tiers)
base_{small,1M,full}.dev.gt (exact top-10 ids+dists per tier)

CSR binary layout: int64 nrow, ncol, nnz; int64 indptr[nrow+1];
int32 indices[nnz]; float32 data[nnz].
"""
import os
import struct

import numpy as np

DATA = os.environ.get("BENCH_SPARSE_DATA", "/data/bigann")
DIMENSIONS = 30_109 # ncol of the SPLADE vocabulary in this encoding
K = 10

# Map our scale names to the Big-ANN base tiers.
SCALE_FILE = {"tiny": "base_small.csr", "small": "base_1M.csr",
"medium": "base_full.csr"}
SCALE_GT = {"tiny": "base_small.dev.gt", "small": "base_1M.dev.gt",
"medium": "base_full.dev.gt"}
SCALE_DOCS = {"tiny": 100_000, "small": 1_000_000, "medium": 8_841_823}
# All tiers share the same 6980 dev queries; cap at 1000 for stable percentiles
# at bounded cost (recall@10 is an average and converges well below 1000; a
# headline serial pass can bump this back to the full 6980 if desired).
SCALE_QUERIES = {"tiny": 1_000, "small": 1_000, "medium": 1_000}

_N_TO_SCALE = {n: s for s, n in SCALE_DOCS.items()}


def _csr_header(fh):
nrow, ncol, nnz = struct.unpack("<qqq", fh.read(24))
return nrow, ncol, nnz


def _scale_for_n(n):
if n in _N_TO_SCALE:
return _N_TO_SCALE[n]
# nearest tier at/above n (smoke runs may pass a smaller cap)
for s in ("tiny", "small", "medium"):
if n <= SCALE_DOCS[s]:
return s
return "medium"


def _stream_csr(path, limit):
"""Yield (ordinal, indices_list, values_list) for the first `limit` rows."""
with open(path, "rb") as fh:
nrow, ncol, nnz = _csr_header(fh)
n = min(limit, nrow) if limit else nrow
indptr = np.frombuffer(fh.read(8 * (nrow + 1)), dtype="<i8")
# indices + data are read in row-chunks to bound memory at 8.8M scale
idx_base = 24 + 8 * (nrow + 1)
dat_base = idx_base + 4 * nnz
CH = 200_000
r = 0
while r < n:
r1 = min(r + CH, n)
lo, hi = int(indptr[r]), int(indptr[r1])
fh.seek(idx_base + 4 * lo)
idxs = np.frombuffer(fh.read(4 * (hi - lo)), dtype="<i4")
fh.seek(dat_base + 4 * lo)
vals = np.frombuffer(fh.read(4 * (hi - lo)), dtype="<f4")
for rr in range(r, r1):
a, b = int(indptr[rr]) - lo, int(indptr[rr + 1]) - lo
yield rr, idxs[a:b].tolist(), vals[a:b].tolist()
r = r1


def gen_docs(n, seed=None):
scale = _scale_for_n(n)
path = os.path.join(DATA, SCALE_FILE[scale])
yield from _stream_csr(path, n)


def gen_queries(n_queries, seed=None):
path = os.path.join(DATA, "queries.dev.csr")
return [(idx, vals) for _, idx, vals in _stream_csr(path, n_queries)]


def load_gt(scale):
"""Exact top-K neighbour ids, shape (n_queries, K)."""
with open(os.path.join(DATA, SCALE_GT[scale]), "rb") as fh:
nq, k = struct.unpack("<II", fh.read(8))
ids = np.frombuffer(fh.read(4 * nq * k), dtype="<i4").reshape(nq, k)
return ids.astype(np.int64)
26 changes: 26 additions & 0 deletions paper-icde/experiments/build_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Build the per-backend bench images. ARCADEDB_WHEEL=<path> bakes a local wheel
# into icde-bench:arcadedb instead of the PyPI pin.
set -eu
cd "$(dirname "$0")"

ARCADE_PKGS="arcadedb-embedded==26.8.1.dev3 numpy pandas pyarrow"
mkdir -p docker-wheels && rm -f docker-wheels/*.whl
if [ -n "${ARCADEDB_WHEEL:-}" ]; then
cp "$ARCADEDB_WHEEL" docker-wheels/
ARCADE_PKGS="numpy pandas pyarrow"
echo "using local wheel: $(basename "$ARCADEDB_WHEEL")"
fi

declare -A PKGS=(
[arcadedb]="$ARCADE_PKGS"
[duckdb]="duckdb pandas pyarrow"
[client]="requests psycopg[binary] pandas pyarrow numpy qdrant-client==1.18.0 pymilvus==3.0.0 elasticsearch==9.4.1 neo4j==6.2.0 ladybug==0.18.1"
[dense]="chromadb==1.5.9 lancedb==0.34.0 sqlite-vec==0.1.9 duckdb==1.5.4 numpy pandas pyarrow"
)
targets=("$@"); [ ${#targets[@]} -eq 0 ] && targets=(arcadedb duckdb client dense)
for be in "${targets[@]}"; do
echo "=== icde-bench:$be (${PKGS[$be]})"
docker build -q -t "icde-bench:$be" --build-arg PIP_PACKAGES="${PKGS[$be]}" \
-f Dockerfile.bench . >/dev/null && echo " ok"
done
42 changes: 42 additions & 0 deletions paper-icde/experiments/dense_common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""Shared dense-vector corpus/query generator for the L3d lane.

Unit-normalized float32 vectors, 1024-dim (mirrors upstream issue #3144's
MSMARCO-shaped 1M x 1024 cell: ~4 GB raw at small scale). Deterministic per
(seed, scale) via numpy PCG64 so adapters and the GT builder regenerate
identical data in any container. Cosine similarity on unit vectors == dot.
"""
import numpy as np

DIMENSIONS = 1024
K = 10
# HNSW operating point, matched across engines (protocol override 3)
HNSW_M = 16
HNSW_EF_CONSTRUCTION = 200
EF_SEARCH_SWEEP = [16, 32, 64, 128, 256]

SCALE_VECTORS = {"micro": 5_000, "tiny": 100_000, "small": 1_000_000,
"medium": 2_000_000}
SCALE_QUERIES = {"micro": 50, "tiny": 200, "small": 200, "medium": 100}

DOC_SEED = 20260709
QUERY_SEED = 515151
GEN_CHUNK = 50_000


def gen_vector_chunks(n, seed=DOC_SEED):
"""Yield (start_ordinal, float32 array [chunk, DIMENSIONS]) unit rows."""
rng = np.random.Generator(np.random.PCG64(seed))
done = 0
while done < n:
m = min(GEN_CHUNK, n - done)
v = rng.standard_normal((m, DIMENSIONS), dtype=np.float32)
v /= np.linalg.norm(v, axis=1, keepdims=True)
yield done, v
done += m


def gen_queries(n_queries, seed=QUERY_SEED):
rng = np.random.Generator(np.random.PCG64(seed))
q = rng.standard_normal((n_queries, DIMENSIONS), dtype=np.float32)
q /= np.linalg.norm(q, axis=1, keepdims=True)
return q
5 changes: 5 additions & 0 deletions paper-icde/experiments/docker-conf/embedEtcd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
listen-client-urls: http://0.0.0.0:2379
advertise-client-urls: http://0.0.0.0:2379
quota-backend-bytes: 4294967296
auto-compaction-mode: revision
auto-compaction-retention: '1000'
Empty file.
15 changes: 15 additions & 0 deletions paper-icde/experiments/gen_dense_npy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python3
"""One-time host-side prep: ann-benchmarks HDF5 -> raw .npy files so bench
containers need only numpy. Writes train/test/neighbors under data/dense/.
Usage: uv run --no-project --with h5py --with numpy python gen_dense_npy.py"""
import os
import h5py
import numpy as np

HERE = os.path.dirname(os.path.abspath(__file__))
D = os.path.join(HERE, "data", "dense")
f = h5py.File(os.path.join(D, "sift-128-euclidean.hdf5"), "r")
np.save(os.path.join(D, "sift_train.npy"), np.asarray(f["train"], dtype=np.float32))
np.save(os.path.join(D, "sift_test.npy"), np.asarray(f["test"], dtype=np.float32))
np.save(os.path.join(D, "sift_neighbors.npy"), np.asarray(f["neighbors"], dtype=np.int64))
print("train", f["train"].shape, "test", f["test"].shape, "gt", f["neighbors"].shape)
Loading