Skip to content

Official implementation (learning part) for paper: Numerically Accurate Hyperbolic Embeddings Using Tiling-Based Models

License

Notifications You must be signed in to change notification settings

ydtydr/HyperbolicTiling_Learning

Repository files navigation

Numerically Accurate Hyperbolic Embeddings Using Tiling-Based Models

Authors:

H266.png

Introduction

This repo contains official code (learning part in PyTorch) and models for the NeurIPS 2019 paper, Numerically Accurate Hyperbolic Embeddings Using Tiling-Based Models. We implemented our models under the same frame of Poincaré Embeddings for Learning Hierarchical Representations, which is licensed under LICENSE and CC-BY-NC 4.0. However, we preserve the rights for commerical purpose of our tiling-based models.

Installation

Clone this repository and run following commands

git clone https://github.com/ydtydr/HyperbolicTiling_Learning.git
cd HyperbolicTiling_Learning
conda env create -f environment.yml
source activate tiling
python setup.py build_ext --inplace

Dependencies

  • Python 3 with NumPy
  • PyTorch
  • Scikit-Learn
  • NLTK (to generate the WordNet data)

Example: Embedding WordNet Mammals

First generate the transitive closure of data via

cd wordnet
python transitive_closure.py

This will generate the transitive closure of the full noun, verb hierarchy as well as of the mammals subtree of WordNet. We also include the Gr-QC dataset in wordnet folder.

To embed the mammals subtree in the reconstruction setting, go to the root directory of the project and run

./train-mammals.sh

This shell script includes the appropriate parameter settings for the mammals subtree. Similar scripts to learn embeddings of Word nouns, Verbs and Gr-QC are located at train-nouns.sh, train-verbs.sh, train-grqc.sh. These scripts contain the hyperparameters to reproduce the embeddings results in the paper with available models: Poincare, Lorentz, NLorentz, LTiling_rsgd, NLTiling_rsgd, LTiling_sgd and HTiling_rsgd. Multithreaded async SGD training is also supported.

References

If you use our code or wish to refer to our results, please use the following BibTex entry:

@incollection{yu2019numerically,
  title = {Numerically Accurate Hyperbolic Embeddings Using Tiling-Based Models},
  author = {Yu, Tao and De Sa, Christopher M},
  booktitle = {Proceedings of the 33rd Conference on Neural Information Processing Systems (NeurIPS 2019)},
  month = {Oct.},
  year = {2019}
}

About

Official implementation (learning part) for paper: Numerically Accurate Hyperbolic Embeddings Using Tiling-Based Models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published