{"id":15066209,"url":"https://github.com/emilemathieu/pvae","last_synced_at":"2025-04-10T05:09:45.864Z","repository":{"id":37602456,"uuid":"183016471","full_name":"emilemathieu/pvae","owner":"emilemathieu","description":"code for \"Continuous Hierarchical Representations with Poincaré Variational Auto-Encoders\".","archived":false,"fork":false,"pushed_at":"2023-10-03T22:35:50.000Z","size":519,"stargazers_count":124,"open_issues_count":7,"forks_count":43,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-10T05:09:41.303Z","etag":null,"topics":["hierarchical-data","hyperbolic-geometry","poincare-embeddings","pytorch","vae"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/1901.06033","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emilemathieu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"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":"2019-04-23T13:03:27.000Z","updated_at":"2025-03-05T08:58:24.000Z","dependencies_parsed_at":"2024-10-13T02:11:44.848Z","dependency_job_id":null,"html_url":"https://github.com/emilemathieu/pvae","commit_stats":{"total_commits":7,"total_committers":3,"mean_commits":"2.3333333333333335","dds":0.5714285714285714,"last_synced_commit":"c04ec2149fc4d37fd83946a366780816c0cbe3c0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilemathieu%2Fpvae","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilemathieu%2Fpvae/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilemathieu%2Fpvae/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilemathieu%2Fpvae/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emilemathieu","download_url":"https://codeload.github.com/emilemathieu/pvae/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161273,"owners_count":21057555,"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":["hierarchical-data","hyperbolic-geometry","poincare-embeddings","pytorch","vae"],"created_at":"2024-09-25T01:03:46.873Z","updated_at":"2025-04-10T05:09:45.803Z","avatar_url":"https://github.com/emilemathieu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Continuous Hierarchical Representations with Poincaré Variational Auto-Encoders](https://arxiv.org/abs/1901.06033)\n\n![demonstrative figure](images/tree.png)\n\nCode for reproducing the experiments in the paper:\n```\n@inproceedings{mathieu2019poincare,\n  title={Continuous Hierarchical Representations with Poincar\\'e Variational Auto-Encoders},\n  author={Mathieu, Emile and Le Lan, Charline and Maddison, Chris J. and Tomioka, Ryota and Whye Teh, Yee},\n  booktitle={Advances in Neural Information Processing Systems},\n  year={2019}\n}\n```\n\n## Prerequisites\n`pip install -r -U requirements.txt` or `python3 setup.py install --user`\n\n## Models\n\n### VAE (`--manifold Euclidean`):\n- Prior distribution (`--prior`): `Normal` (`WrappedNormal` is theoretically equivalent)\n- Posterior distribution (`--posterior`): `Normal`  (`WrappedNormal` is theoretically equivalent)\n- Decoder architecture (`--dec`): `Linear` (MLP) (`Wrapped` is theoretically equivalent)\n- Encoder architecture (`--enc`): `Linear` (MLP) (`Wrapped` is theoretically equivalent)\n    \n### PVAE (`--manifold PoincareBall`):\n- Curvature (`--c`): 1.0\n- Prior distribution (`--prior`): `WrappedNormal` or `RiemannianNormal`\n- Posterior distribution (`--posterior`): `WrappedNormal` or `RiemannianNormal`\n- Decoder architecture (`--dec`):\n    - `Linear` (MLP)\n    - `Wrapped` (logarithm map followed by MLP),\n    - `Geo` (first layer is based on geodesic distance to hyperplanes, followed by MLP)\n    - `Mob` (based on Hyperbolic feed-forward layers from Ganea et al (2018))\n- Encoder architecture (`--enc`): `Wrapped` or `Mob`\n\n\n## Run experiments\n\n### Synthetic dataset\n```\npython3 pvae/main.py --model tree --manifold PoincareBall --latent-dim 2 --hidden-dim 200 --prior-std 1.7 --c 1.2 --data-size 50 --data-params 6 2 1 1 5 5 --dec Wrapped --enc Wrapped  --prior RiemannianNormal --posterior RiemannianNormal --epochs 1000 --save-freq 1000 --lr 1e-3 --batch-size 64 --iwae-samples 5000\n```\n\n### MNIST dataset\n```\npython3 pvae/main.py --model mnist --manifold Euclidean             --latent-dim 2 --hidden-dim 600 --prior Normal        --posterior Normal        --dec Wrapped --enc Wrapped --lr 5e-4 --epochs 80 --save-freq 80 --batch-size 128 --iwae-samples 5000\npython3 pvae/main.py --model mnist --manifold PoincareBall --c 0.7  --latent-dim 2 --hidden-dim 600 --prior WrappedNormal --posterior WrappedNormal --dec Geo     --enc Wrapped --lr 5e-4 --epochs 80 --save-freq 80 --batch-size 128 --iwae-samples 5000\n```\n\n### Custom dataset via csv file (placed in `/data`, no header, integer labels on last column)\n```\npython3 pvae/main.py --model csv --data-param CSV_NAME --data-size NB_FEATURES\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilemathieu%2Fpvae","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femilemathieu%2Fpvae","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilemathieu%2Fpvae/lists"}