{"id":28326882,"url":"https://github.com/rpatrik96/ima-vae","last_synced_at":"2025-06-16T02:40:27.532Z","repository":{"id":38110148,"uuid":"431811003","full_name":"rpatrik96/ima-vae","owner":"rpatrik96","description":"This is the code for the paper Embrace the Gap: VAEs perform Independent Mechanism Analysis, showing that optimizing the ELBO is equivalent to optimizing the IMA-regularized log-likelihood under certain assumptions (e.g., small decoder variance).","archived":false,"fork":false,"pushed_at":"2024-04-22T13:43:43.000Z","size":11956,"stargazers_count":23,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-02T10:44:26.318Z","etag":null,"topics":["disentanglement","dsprites","ica","independent-component-analysis","pytorch","pytorch-lightning","vae","variational-autoencoder","variational-inference","wandb"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rpatrik96.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-11-25T10:55:19.000Z","updated_at":"2025-01-02T15:08:26.000Z","dependencies_parsed_at":"2025-04-13T05:07:09.358Z","dependency_job_id":null,"html_url":"https://github.com/rpatrik96/ima-vae","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/rpatrik96/ima-vae","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fima-vae","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fima-vae/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fima-vae/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fima-vae/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rpatrik96","download_url":"https://codeload.github.com/rpatrik96/ima-vae/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fima-vae/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260088180,"owners_count":22957037,"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":["disentanglement","dsprites","ica","independent-component-analysis","pytorch","pytorch-lightning","vae","variational-autoencoder","variational-inference","wandb"],"created_at":"2025-05-26T01:15:20.163Z","updated_at":"2025-06-16T02:40:27.527Z","avatar_url":"https://github.com/rpatrik96.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\n\n\u003cdiv align=\"center\"\u003e    \n \n# Embrace the Gap: VAEs perform Independent Mechanism Analysis   \n\n[//]: # ([![Paper]\u0026#40;http://img.shields.io/badge/paper-arxiv.2206.02416-B31B1B.svg\u0026#41;]\u0026#40;https://arxiv.org/abs/2206.02416\u0026#41;)\n\n[![Conference](http://img.shields.io/badge/NeurIPS-2022-4b44ce.svg)](https://openreview.net/forum?id=G4GpqX4bKAH)\n\n[//]: # ([![Conference]\u0026#40;http://img.shields.io/badge/ICLR-2019-4b44ce.svg\u0026#41;]\u0026#40;https://papers.nips.cc/book/advances-in-neural-information-processing-systems-31-2018\u0026#41;)\n\n[//]: # ([![Conference]\u0026#40;http://img.shields.io/badge/AnyConference-year-4b44ce.svg\u0026#41;]\u0026#40;https://papers.nips.cc/book/advances-in-neural-information-processing-systems-31-2018\u0026#41;  )\n\n[![Paper](http://img.shields.io/badge/arxiv-stat.ML:2206.02416-B31B1B.svg)](https://arxiv.org/abs/2206.02416)\n\n![CI testing](https://github.com/rpatrik96/ima-vae/workflows/CI%20testing/badge.svg?branch=master\u0026event=push)\n[![DOI](https://zenodo.org/badge/431811003.svg)](https://zenodo.org/badge/latestdoi/431811003)\n\n\u003c!--  \nConference   \n--\u003e   \n\u003c/div\u003e\n \n## Description   \nThis is the code for the paper _Embrace the Gap: VAEs perform Independent Mechanism Analysis_, showing that optimizing the ELBO is equivalent to optimizing the IMA-regularized log-likelihood under certain assumptions (e.g., small decoder variance).\n\n## How to run   \nFirst, install dependencies   \n```bash\n# clone ima_vae   \ngit clone --recurse-submodules https://github.com/rpatrik96/ima-vae\n\n# if forgot to pull submodules, run\ngit submodule update --init\n\n# install ima_vae   \ncd ima-vae\npip install -e .   \npip install -r requirements.txt\n\n# install spriteworld\npip install -e ./spriteworld\n\n# install submodule requirements\npip install --requirement ima/requirements.txt --quiet\npip install --requirement tests/requirements.txt --quiet\npip install --requirement spriteworld/requirements.txt --quiet\n\n# install pre-commit hooks (only necessary for development)\npre-commit install\n ```   \n Next, navigate to the `ima-vae` directory and run `ima_vae/cli.py.   \n```bash\n python3 ima_vae/cli.py fit --help\n python3 ima_vae/cli.py fit --config configs/trainer.yaml --config configs/synth/moebius.yaml --model.prior=beta\n```\n\n### Hyperparameter optimization\n\nFirst, you need to log into `wandb`\n```bash\nwandb login #you will find your API key at https://wandb.ai/authorize\n```\n\nThen you can create and run the sweep\n```bash\nwandb sweep sweeps/synth/mlp/finding_optimal_gamma_uniform.yaml  # returns sweep ID\nwandb agent \u003cID-comes-here\u003e --count=\u003cnumber of runs\u003e # when used on a cluster, set it to one and start multiple processes\n```\n\n\n\n## Citation   \n\n```\n@inproceedings{\n reizinger_embrace_2022,\n title={Embrace the Gap: {VAE}s Perform Independent Mechanism Analysis},\n author={Patrik Reizinger and Luigi Gresele and Jack Brady and Julius Von K{\\\"u}gelgen and Dominik Zietlow and Bernhard Sch{\\\"o}lkopf and Georg Martius and Wieland Brendel and Michel Besserve},\n booktitle={Advances in Neural Information Processing Systems},\n editor={Alice H. Oh and Alekh Agarwal and Danielle Belgrave and Kyunghyun Cho},\n year={2022},\n url={https://openreview.net/forum?id=G4GpqX4bKAH}\n}\n\n```   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpatrik96%2Fima-vae","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frpatrik96%2Fima-vae","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpatrik96%2Fima-vae/lists"}