Skip to content

Official implementation of Highly Scalable and Provably Accurate Classification in Poincaré Balls (ICDM regular paper 2021)

License

Notifications You must be signed in to change notification settings

thupchnsky/PoincareLinearClassification

Repository files navigation

Official Implementation of Efficient Linear Classification in Hyperbolic Space

Programming language: Python 3.7. Tested on operating systems: Windows 10, CentOS 7.7.1908

Poincare Embedding for Real Datasets

image info

The Jupyter notebook HP_single_exp.ipynb contains a simple example code for our hyperbolic perceptron algorithms, hyperbolic perceptron from Weber et al. and Euclidean perceptron on synthetic data with visualization.

Reproducing our experiments of Fig 7 and Table 1

python Synthetic_exp.py --savepath [your saving path] 

The experimental setting that can be changed are listed as follows:
--N: Number of points (default: 100000)
--d: Dimension (default: 2)
--gamma: Margin (default: 0.01)
--R: Upper bound of the norm of data points (default: 0.95)
--a: The hyperparameter in the second order perceptron (default: 0)
--thread: Number of threads used for parallelization (default: 20)
--chucksize: Chucksize for parallelization (default: 1)
--Repeat: Number of repeat of experiments (default: 20)

Note that you can comment out some methods that you don't want to test in the file Synthetic_exp.py. We have a more detail instruction in it.

The output will be saved as a (3,5,Repeat) numpy arrany.
First axis: acc, mistakes (for perceptron only), running time.
Second axis: methods. They are our hyperbolic perceptron, our second order hyperbolic perceptron, our hyperbolic SVM, SVM from Cho et al., Euclidean SVM.

More details about the usage TBA

How to choose the reference point p

TBA

Contact

Please contact Chao Pan ([email protected]), Eli Chien ([email protected]) if you have any question.

About

Official implementation of Highly Scalable and Provably Accurate Classification in Poincaré Balls (ICDM regular paper 2021)

Topics

Resources

License

Stars

Watchers

Forks