poincare-embeddings

PyTorch implementation of the NIPS-17 paper "Poincaré Embeddings for Learning Hierarchical Representations"

  • 所有者: facebookresearch/poincare-embeddings
  • 平台:
  • 許可證: Other
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

  • Poincaré Embeddings for Learning Hierarchical Representations

PyTorch implementation of [[https://papers.nips.cc/paper/7213-poincare-embeddings-for-learning-hierarchical-representations][Poincaré Embeddings for Learning Hierarchical Representations]]

** Installation
Simply clone this repository via
#+BEGIN_SRC sh
git clone https://github.com/facebookresearch/poincare-embeddings.git
cd poincare-embeddings
conda env create -f environment.yml
source activate poincare
python setup.py build_ext --inplace
#+END_SRC

** Example: Embedding WordNet Mammals
To embed the transitive closure of the WordNet mammals subtree, first generate the data via
#+BEGIN_SRC sh
cd wordnet
python transitive_closure.py
#+END_SRC
This will generate the transitive closure of the full noun hierarchy as well as of the mammals subtree of WordNet.

To embed the mammals subtree in the reconstruction setting (i.e., without missing data), go to the /root directory/ of the project and run
#+BEGIN_SRC sh
./train-mammals.sh
#+END_SRC
This shell script includes the appropriate parameter settings for the mammals subtree and saves the trained model as =mammals.pth=.

An identical script to learn embeddings of the entire noun hierarchy is located at =train-nouns.sh=. This script contains the hyperparameter setting to reproduce the results for 10-dimensional embeddings of [[https://papers.nips.cc/paper/7213-poincare-embeddings-for-learning-hierarchical-representations][(Nickel & Kiela, 2017)]]. The hyperparameter setting to reproduce the MAP results are provided as comments in the script.

The embeddings are trained via multithreaded async SGD. In the example above, the number of threads is set to a conservative setting (=NHTREADS=2=) which should run well even on smaller machines. On machines with many cores, increase =NTHREADS= for faster convergence.

** Dependencies

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

** References
If you find this code useful for your research, please cite the following paper in your publication:
#+BEGIN_SRC bibtex
@incollection{nickel2017poincare,
title = {Poincar'{e} Embeddings for Learning Hierarchical Representations},
author = {Nickel, Maximilian and Kiela, Douwe},
booktitle = {Advances in Neural Information Processing Systems 30},
editor = {I. Guyon and U. V. Luxburg and S. Bengio and H. Wallach and R. Fergus and S. Vishwanathan and R. Garnett},
pages = {6341--6350},
year = {2017},
publisher = {Curran Associates, Inc.},
url = {http://papers.nips.cc/paper/7213-poincare-embeddings-for-learning-hierarchical-representations.pdf}
}
#+END_SRC

** License
This code is licensed under [[https://creativecommons.org/licenses/by-nc/4.0/][CC-BY-NC 4.0]].

主要指標

概覽
名稱與所有者facebookresearch/poincare-embeddings
主編程語言Python
編程語言Python (語言數: 3)
平台
許可證Other
所有者活动
創建於2018-01-19 18:53:04
推送於2025-05-23 17:51:10
最后一次提交
發布數1
最新版本名稱1.0 (發布於 )
第一版名稱1.0 (發布於 )
用户参与
星數1.7k
關注者數48
派生數236
提交數27
已啟用問題?
問題數70
打開的問題數26
拉請求數0
打開的拉請求數5
關閉的拉請求數12
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?