Code for LORE: Jointly Learning the Intrinsic Dimensionality and Relative Similarity Structure From Ordinal Data
By Vivek Anand, Alec Helbling, Mark A. Davenport, Gordon J Berman, Sankaraleengam Alagapan and Christopher J Rozell
Paper: https://arxiv.org/abs/2602.04192
We use conda to install and manage our environment.
-
Install the
lore_envenvironment with the commandconda env create -f env/environment.yml. -
Activate the environment with the command
conda activate lore_env -
Install the modified cblearn package from source (included in the repo) with the command
pip install -e env/cblearn
Note. We highly recommend that you run our code with access to a GPU. We have lightly tested our code with CPU backends without it breaking but cannot guarantee that it will work in all cases.
For a detailed breakdown of the repository's directories and files, please refer to our Repository Structure Documentation.
The lore/ folder contains the helper functions necessary to train using LORE. Specifically, it contains three important components.
lore.f- which containsLogisticTripletLosswhich defines the our modified triplet loss.lore.g- which contains the definitions for the various possible rank regularizationsLinearandSchattenPUnnormedwhich are the nuclear norm and the Schatten-$p$-norm respectively.lore.triplet_algorithmwhich contains the training algorithm for LORE given an f and g. Our python implementation is heavily inspired by this matlab implementation.
A full working demo of LORE compared to other OE baselines can be seen in demo.ipynb. Eventually, we will integrate LORE as a new embedding method into cblearn.
Run and step through crown_jewel.ipynb.
If you seek to re-run our experiments for the artificial perceptual experiment please do the following. (This script requires a GPU to run tractably)
- Run
python src/run_artificial_perceptual_experiment.py, this should create a pkl files inresults/artificial_perceptual_experiment/. - Step through the
src/plot_artificial_perceptual_experiment.ipynbnotebook to obtain the plots in our paper..
If you seek to re-run our experiments for the Crowdsourced Datasets please do the following. (This script requires a GPU to run tractably). The three datasets are cars, food100 and musicians.
- Run
python src/run_{dataset}.py, this should create a csv file inresults/dataset/. - Step through the
src/plot_{dataset}.ipynbnotebook to obtain the summary statistics used in the table.
For the interpretability plots for food100, step through plot_food100_interpretability.ipynb using the embedding learned in the crowdsourced experiment.
Please run python src/run_scaling.py and python src/run_convergence.py to obtain the results for the convergence and scaling experiments. Step through the src/plot_scaling.ipynb and src/plot_convergence.ipynb notebooks to obtain the plots in our paper.
After running the crowdsourced experiments, you can generate the interpretability plots by running the src/plot_food100_interpretability.ipynb notebook.
Please run python src/run_p_experiment.py to obtain the results for the effects of different p (we run additional gridsearches compared to the ones just described here). A GPU and a CPU with multiple cores will be necessary to run through tractably. Then step through the src/plot_different_p.ipynb notebook to obtain the plots in our paper.
We do not include code for the other figures in our paper as they are involve complex grid searches that need to be parallelized across multiple GPUs. However, as we have detailed in our appendix, all one needs to do is run over all parameter combinations for intrinsic rank, number of percepts, noise, fraction of queries used, lambda for LORE and embedding dimension for all other OEs. The procedure to run each individual parameter combination is identical to the one included in demo.ipynb and very similar to that in src/run_different_p.py. For further operational details, we direct the reader to our paper.
If you found our work interesting and use our code, please cite us with the following.
@inproceedings{anand2026lore,
title={LORE: Jointly Learning The Intrinsic Dimensionality and Relative Similarity Structure from Ordinal Data},
author={Anand, Vivek and Helbling, Alec and Davenport, Mark A. and Berman, Gordon J and Alagapan, Sankaraleengam and Rozell, Christopher J},
paper_url = {https://arxiv.org/abs/2602.04192},
booktitle={International Conference on Learning Representations (ICLR)},
month = {April},
address = {Rio de Janeiro, Brazil},
year={2026}
}