{"id":28326891,"url":"https://github.com/rpatrik96/nl-causal-representations","last_synced_at":"2025-07-03T17:36:01.915Z","repository":{"id":85390461,"uuid":"361117778","full_name":"rpatrik96/nl-causal-representations","owner":"rpatrik96","description":"This is the code for the paper Jacobian-based Causal Discovery with Nonlinear ICA, demonstrating how identifiable representations (particularly, with Nonlinear ICA) can be used to extract the causal graph from an underlying structural equation model (SEM).","archived":false,"fork":false,"pushed_at":"2024-09-05T19:44:46.000Z","size":6990,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-22T14:40:45.564Z","etag":null,"topics":["causal-discovery","causal-discovery-methods","causal-inference","causality","deep-learning","deep-neural-networks","deeplearning","ica","independent-component-analysis","machine-learning","structural-causal-model"],"latest_commit_sha":null,"homepage":"","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/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-04-24T09:10:11.000Z","updated_at":"2025-03-26T12:45:27.000Z","dependencies_parsed_at":"2024-06-28T21:45:45.218Z","dependency_job_id":"ffbd881e-4662-4ed5-9d10-12ef444016cd","html_url":"https://github.com/rpatrik96/nl-causal-representations","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/rpatrik96/nl-causal-representations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fnl-causal-representations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fnl-causal-representations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fnl-causal-representations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fnl-causal-representations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rpatrik96","download_url":"https://codeload.github.com/rpatrik96/nl-causal-representations/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpatrik96%2Fnl-causal-representations/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263370171,"owners_count":23456425,"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":["causal-discovery","causal-discovery-methods","causal-inference","causality","deep-learning","deep-neural-networks","deeplearning","ica","independent-component-analysis","machine-learning","structural-causal-model"],"created_at":"2025-05-26T01:15:23.376Z","updated_at":"2025-07-03T17:36:01.905Z","avatar_url":"https://github.com/rpatrik96.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e \n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7002143.svg)](https://doi.org/10.5281/zenodo.7002143)\n\n![CI testing](https://github.com/rpatrik96/nl-causal-representations/workflows/Python%20package/badge.svg?branch=master\u0026event=push)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit)\n\n\u003c/div\u003e\n\n# Jacobian-based Causal Discovery with Nonlinear ICA\n\n\n## Description\nThis is the code for the paper _Jacobian-based Causal Discovery with Nonlinear ICA_, demonstrating how identifiable representations (particularly, with Nonlinear ICA) can be used to extract the causal graph from an underlying structural equation model (SEM).\n\n## Before running the code\n\n### Singularity container build\n\n```bash\nsingularity build --fakeroot nv.sif nv.def\n```\n\n### Logging\n\n1. First, you need to log into `wandb`\n```bash\nwandb login #you will find your API key at https://wandb.ai/authorize\n```\n\n2. Second, you need to specify the project for logging, which you can in the `before_fit` method in [cli.py](https://github.com/rpatrik96/nl-causal-representations/blob/master/care_nl_ica/cli.py#L37)\n```python\n    def before_fit(self):\n        if isinstance(self.trainer.logger, WandbLogger) is True:\n            # required as the parser cannot parse the \"-\" symbol\n            self.trainer.logger.__dict__[\"_wandb_init\"][\n                \"entity\"\n            ] = \"causal-representation-learning\" # \u003c--- modify this line\n```\n\n3. Then, you can create and run the sweep\n```bash\nwandb sweep sweeps/sweep_file.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## Usage \n\n1. Clone\n```bash\n git clone https://github.com/rpatrik96/nl-causal-representations.git\n```\n\n2. Install\n```bash\n# install package\npip3 install -e .\n\n# install requirements \npip install -r requirements.txt\n\n# install pre-commit hooks\npre-commit install\n```\n\n3. Run:\n```bash\npython3 care_nl_ica/cli.py fit --config configs/config.yaml\n```\n\n\n\n\n### Code credits\nOur repo extensively relies on `cl-ica` [repo](https://github.com/brendel-group/cl-ica), so please consider citing the corresponding [paper](http://proceedings.mlr.press/v139/zimmermann21a/zimmermann21a.pdf) as well\n\n\n# Reference\nIf you find our work useful, please consider citing our [TMLR paper](https://openreview.net/forum?id=2Yo9xqR6Ab)\n\n```bibtex\n@article{reizinger2023jacobianbased,\n  author = {\n    Reizinger, Patrik and\n    Sharma, Yash and\n    Bethge, Matthias and\n    Schölkopf, Bernhard and\n    Huszár, Ferenc and\n    Brendel, Wieland\n  },\n  title = {\n    Jacobian-based Causal Discovery with Nonlinear {ICA}\n  },\n  journal={Transactions on Machine Learning Research},\n  issn={2835-8856},\n  year={2023},\n  url={https://openreview.net/forum?id=2Yo9xqR6Ab},\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpatrik96%2Fnl-causal-representations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frpatrik96%2Fnl-causal-representations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpatrik96%2Fnl-causal-representations/lists"}