This repository holds all experiments supporting The Numerical Stability of Hyperbolic Representation Learning, ICML 2023.
Two functionalities are available:
-
shallow tree embeddings in different manifolds (Euclidean, Poincare, Lorentz, and Reparemtrized Euclidean;
-
stable hyperbolic SVM: compare the performances among
- ESVM: Euclidean SVM
- LSVM: Lorentz SVM with non-convex constraints
- PSVM: Poincare SVM with precomputed reference points
- LSVMPP: Lorentz SVM with reparametrized loss functions without the non-convex constraints. (PP stands for plus plus, as inspired by Hyperbolic Neural Network++)
To run stable hyperbolic SVM, train_svm.py contains all programs to train four models. An example training script is as follows: at root,
python src/train_svm.py --model LSVMPP --C 5 --epochs 5000 --data cifar --refpt raw
See commands folder for more running scripts.
with conda installed, we may install the folloing env to run the codes.
conda create -n shyp
conda activate shyp
conda install python==3.8
pip install torch torchvision torchaudio
pip install autopep8 jupyterlab toml timebudget tensorboard rich torch-tb-profiler
pip install --no-cache-dir geoopt==0.4.1
pip install --no-cache-dir statsmodels seaborn scipy pillow networkx tqdm gpustat scikit-learn
create a file named config.toml that contains the path for data and results. An example is shown below:
['tree']
data_dir = 'data/tree/'
result_dir = 'results/tree/'
['svm']
data_dir = 'data/svm/'
result_dir = 'results/svm/'
change tag
arccordingly to redirect reading and saving paths.
Authors: Sheng Yang, Zhengchao Wan.
Please contact Sheng Yang for any questions on running the repository.