{"id":13689438,"url":"https://github.com/facebookresearch/poincare-embeddings","last_synced_at":"2025-05-15T13:06:36.165Z","repository":{"id":43175424,"uuid":"118165119","full_name":"facebookresearch/poincare-embeddings","owner":"facebookresearch","description":"PyTorch implementation of the NIPS-17 paper \"Poincaré Embeddings for Learning Hierarchical Representations\"","archived":false,"fork":false,"pushed_at":"2024-07-25T10:14:43.000Z","size":406,"stargazers_count":1703,"open_issues_count":31,"forks_count":233,"subscribers_count":48,"default_branch":"main","last_synced_at":"2025-04-14T20:58:53.114Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/facebookresearch.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-19T18:53:04.000Z","updated_at":"2025-04-14T09:42:20.000Z","dependencies_parsed_at":"2024-01-26T16:25:40.371Z","dependency_job_id":"cf460b9f-57dd-48b1-91b3-2c450660b87a","html_url":"https://github.com/facebookresearch/poincare-embeddings","commit_stats":{"total_commits":26,"total_committers":9,"mean_commits":2.888888888888889,"dds":0.7692307692307692,"last_synced_commit":"b1364a1c19a6ab28256c8c11c1b1064a1038b762"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookresearch%2Fpoincare-embeddings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookresearch%2Fpoincare-embeddings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookresearch%2Fpoincare-embeddings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookresearch%2Fpoincare-embeddings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/facebookresearch","download_url":"https://codeload.github.com/facebookresearch/poincare-embeddings/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T15:01:47.897Z","updated_at":"2025-05-15T13:06:36.140Z","avatar_url":"https://github.com/facebookresearch.png","language":"Python","funding_links":[],"categories":["Python","Uncategorized","Paper implementations｜论文实现","Paper implementations"],"sub_categories":["Uncategorized","Other libraries｜其他库:","Other libraries:"],"readme":"* Poincaré Embeddings for Learning Hierarchical Representations\n\nPyTorch implementation of [[https://papers.nips.cc/paper/7213-poincare-embeddings-for-learning-hierarchical-representations][Poincaré Embeddings for Learning Hierarchical Representations]]\n\n[[file:wn-nouns.jpg]]\n\n** Installation\nSimply clone this repository via\n#+BEGIN_SRC sh\n  git clone https://github.com/facebookresearch/poincare-embeddings.git\n  cd poincare-embeddings\n  conda env create -f environment.yml\n  source activate poincare\n  python setup.py build_ext --inplace\n#+END_SRC\n\n** Example: Embedding WordNet Mammals\nTo embed the transitive closure of the WordNet mammals subtree, first generate the data via\n#+BEGIN_SRC sh\n  cd wordnet\n  python transitive_closure.py\n#+END_SRC\nThis will generate the transitive closure of the full noun hierarchy as well as of the mammals subtree of WordNet.\n\nTo embed the mammals subtree in the reconstruction setting (i.e., without missing data), go to the /root directory/ of the project and run\n#+BEGIN_SRC sh\n  ./train-mammals.sh\n#+END_SRC\nThis shell script includes the appropriate parameter settings for the mammals subtree and saves the trained model as =mammals.pth=.\n\nAn 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 \u0026 Kiela, 2017)]]. The hyperparameter setting to reproduce the MAP results are provided as comments in the script.\n\nThe 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.\n\n** Dependencies\n- Python 3 with NumPy\n- PyTorch\n- Scikit-Learn\n- NLTK (to generate the WordNet data)\n\n** References\nIf you find this code useful for your research, please cite the following paper in your publication:\n#+BEGIN_SRC bibtex\n@incollection{nickel2017poincare,\n  title = {Poincar\\'{e} Embeddings for Learning Hierarchical Representations},\n  author = {Nickel, Maximilian and Kiela, Douwe},\n  booktitle = {Advances in Neural Information Processing Systems 30},\n  editor = {I. Guyon and U. V. Luxburg and S. Bengio and H. Wallach and R. Fergus and S. Vishwanathan and R. Garnett},\n  pages = {6341--6350},\n  year = {2017},\n  publisher = {Curran Associates, Inc.},\n  url = {http://papers.nips.cc/paper/7213-poincare-embeddings-for-learning-hierarchical-representations.pdf}\n}\n#+END_SRC\n\n** License\nThis code is licensed under [[https://creativecommons.org/licenses/by-nc/4.0/][CC-BY-NC 4.0]].\n\n[[https://img.shields.io/badge/License-CC%20BY--NC%204.0-lightgrey.svg]]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookresearch%2Fpoincare-embeddings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffacebookresearch%2Fpoincare-embeddings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookresearch%2Fpoincare-embeddings/lists"}