Learned Metric Index (LMI)
Project description
Learned Metric Index (LMI)
This project implements a Learned Metric Index using PyTorch and Rust.
Prerequisites
- Python 3.11 (will likely work with other versions, but only tested with this one)
- Rust toolchain (nightly)
- GCC compiler
Setup Instructions
- Install pipenv if you haven't already
pip install pipenv
- Install all dependencies specified in Pipfile.lock
pipenv --python python3.11 sync
- Activate the virtual environment
pipenv shell
- Build the Rust component and install the package using maturin
RUSTFLAGS="-C linker=gcc" LIBTORCH_USE_PYTORCH=1 maturin develop --release
Downloading the data
From this folder run
cd .. && mkdir data2024 && cd data2024
wget https://sisap-23-challenge.s3.amazonaws.com/SISAP23-Challenge/laion2B-en-clip768v2-n=300K.h5
wget http://ingeotec.mx/~sadit/sisap2024-data/public-queries-2024-laion2B-en-clip768v2-n=10k.h5
wget http://ingeotec.mx/~sadit/sisap2024-data/gold-standard-dbsize=300K--public-queries-2024-laion2B-en-clip768v2-n=10k.h5
cd ../lmi
The first wget will probably not work, so you need to get the dataset from elsewhere :)
Running the Project
After setting up the environment, you can run the Python file:
python3 test.py
This will train the LMI on the 300k SISAP24 dataset and evaluate it on 10k public queries.
You can get the evaluation with
python3 eval.py --results result res.csv
and then
cat res.csv
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lmi_rs-0.4.1-cp311-cp311-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: lmi_rs-0.4.1-cp311-cp311-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 20.2 MB
- Tags: CPython 3.11, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4a8b934f534f7c70cdc99c2cba385ed03d9a69ec75138e63c27b767498d2a24
|
|
| MD5 |
69b4fdaf6682b067cb409382aaf968e9
|
|
| BLAKE2b-256 |
c72cecda60eb2b9532d2815a37c3dcc698de3165938ac1f8650f987b0eb3da63
|