Skip to main content

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

  1. Install pipenv if you haven't already
pip install pipenv
  1. Install all dependencies specified in Pipfile.lock
pipenv --python python3.11 sync
  1. Activate the virtual environment
pipenv shell
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

lmi_rs-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl (12.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

lmi_rs-0.3.0-cp311-cp311-manylinux_2_28_x86_64.whl (13.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

File details

Details for the file lmi_rs-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for lmi_rs-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 60348a4d11e256abf0b4fa7fb175a69d0415998ed354b9fda0e01705c2b2a5fd
MD5 171695a9321509580d243317d503b9ad
BLAKE2b-256 af2f341ad50611916034e473d6ccd7e499e7f392849b9230315a4e1bdfd0261c

See more details on using hashes here.

File details

Details for the file lmi_rs-0.3.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lmi_rs-0.3.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 62c2191934933903128b9bd7a92422b9600a186cfb581a34854f66603ec0d40e
MD5 b81e774104e938606079047d2c2f23ad
BLAKE2b-256 6b808d756d8ea1d266f5cd98fb0ea1f673940e37f8604b8bf8ff44763759126d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page