Important
🚧 This repository is still in construction.
This repository contains the code for the article "Horospherical Learning with Smart Prototypes" to be published at BMVC2024. The full paper can be found here.
In order to generate uniformly distributed prototypes on the hypersphere (i.e. the boundary of the Poincaré ball), we use the same technique as the one used by Ghadimi Atigh et al. and Wang et Isola. which is to optimize a set of points on the hypersphere by maximizing the pairwise distances between points.
C=252 # Number of classes
D=256 # Number of dimensions
EPOCHS=100_000 # Number of epochs
python prototype_learning.py \
-c $C \
-d $D \
-e $EPOCHS \
-r prototypesuniform_${D}d_${C}c.npyAfter some number crunching, it will generate the file prototypesuniform_256d_10c.npy on disk.
In order to assign these randomly generated prototypes according to the method presented in the article, one need to have a label hierarchy and a set of prototypes (one for each node in the hierarchy).
DATASET=cub
python gromov_protos.py \
-d $D \
--dataset $DATASET \
--input-protos prototypesuniform_${D}d_${C}c.npy \
--output-file prototypesgromov_${D}d_200c.npyThe code for the horospherical classifier presented in the article is located in the file horospherical.py.
In the paper, several kind of experiments on classification over hierarchical data is performed.
The code for the image classification experiments is located in folder classification/.
The following datasets have been used:
- CUB200 - should be downloaded and extracted in the
data/folder under the namedata/CUB_200_2011/. - CIFAR10 - will be automatically downloaded in the
datafolder. - CIFAR100 - will be automatically downloaded in the
datafolder.
TO BE RELEASED.
TO BE RELEASED.
This code depends on the following python packages.
A conda environment is available in the env.yml file to reproduce the same versions.
If this repository or the article is helpful to your research, considering citing the corresponding article:
@inproceedings{berg2024horospherical,
title={Horospherical Learning with Smart Prototypes},
author={Berg, Paul and Michele, Bjoern and Pham, Minh-Tan and Chapel, Laetitia and Courty, Nicolas},
booktitle={Proceedings of the British Machine Vision Conference (BMVC)},
year={2024}
}