nl-causal-representations

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).

https://github.com/rpatrik96/nl-causal-representations

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.3%) to scientific vocabulary

Keywords

causal-discovery causal-discovery-methods causal-inference causality deep-learning deep-neural-networks deeplearning ica independent-component-analysis machine-learning structural-causal-model
Last synced: 4 months ago · JSON representation ·

Repository

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).

Basic Info
  • Host: GitHub
  • Owner: rpatrik96
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 6.67 MB
Statistics
  • Stars: 18
  • Watchers: 2
  • Forks: 2
  • Open Issues: 0
  • Releases: 2
Topics
causal-discovery causal-discovery-methods causal-inference causality deep-learning deep-neural-networks deeplearning ica independent-component-analysis machine-learning structural-causal-model
Created over 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7002143.svg)](https://doi.org/10.5281/zenodo.7002143) ![CI testing](https://github.com/rpatrik96/nl-causal-representations/workflows/Python%20package/badge.svg?branch=master&event=push) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)

Jacobian-based Causal Discovery with Nonlinear ICA

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).

Before running the code

Singularity container build

bash singularity build --fakeroot nv.sif nv.def

Logging

  1. First, you need to log into wandb bash wandb login #you will find your API key at https://wandb.ai/authorize

  2. Second, you need to specify the project for logging, which you can in the before_fit method in cli.py python def before_fit(self): if isinstance(self.trainer.logger, WandbLogger) is True: # required as the parser cannot parse the "-" symbol self.trainer.logger.__dict__["_wandb_init"][ "entity" ] = "causal-representation-learning" # <--- modify this line

  3. Then, you can create and run the sweep bash wandb sweep sweeps/sweep_file.yaml # returns sweep ID wandb agent <ID-comes-here> --count=<number of runs> # when used on a cluster, set it to one and start multiple processes

Usage

  1. Clone bash git clone https://github.com/rpatrik96/nl-causal-representations.git

  2. Install ```bash

    install package

    pip3 install -e .

install requirements

pip install -r requirements.txt

install pre-commit hooks

pre-commit install ```

  1. Run: bash python3 care_nl_ica/cli.py fit --config configs/config.yaml

Code credits

Our repo extensively relies on cl-ica repo, so please consider citing the corresponding paper as well

Reference

If you find our work useful, please consider citing our TMLR paper

bibtex @article{reizinger2023jacobianbased, author = { Reizinger, Patrik and Sharma, Yash and Bethge, Matthias and Schölkopf, Bernhard and Huszár, Ferenc and Brendel, Wieland }, title = { Jacobian-based Causal Discovery with Nonlinear {ICA} }, journal={Transactions on Machine Learning Research}, issn={2835-8856}, year={2023}, url={https://openreview.net/forum?id=2Yo9xqR6Ab}, }

Owner

  • Name: Patrik Reizinger
  • Login: rpatrik96
  • Kind: user
  • Location: Germany
  • Company: IMPRS-IS, ELLIS

PhD student at IMPRS-IS (University of Tübingen) and ELLIS. Looking into causality and representation learning.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Reizinger"
  given-names: "Patrik"
  orcid: "https://orcid.org/0000-0001-9861-0293"
- family-names: "Sharma"
  given-names: "Yash"
- family-names: "Bethge"
  given-names: "Matthias"
- family-names: "Schölkopf"
  given-names: "Bernhard"
  orcid: "https://orcid.org/0000-0002-8177-0925"
- family-names: "Huszár"
  given-names: "Ferenc"
  orcid: "https://orcid.org/0000-0002-4988-1430"
- family-names: "Brendel"
  given-names: "Wieland"
  orcid: "https://orcid.org/0000-0003-0982-552X"
title: "nl-causal-representations"
version: 1.0.0
doi: 10.5281/zenodo.7002143
date-released: 2022-08-17
url: "https://github.com/rpatrik96/nl-causal-representations"

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Committers

Last synced: 6 months ago

All Time
  • Total Commits: 785
  • Total Committers: 25
  • Avg Commits per committer: 31.4
  • Development Distribution Score (DDS): 0.214
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Patrik Reizinger p****7@g****m 617
Patrik Reizinger p****r@b****l 92
Yash Sharma y****6@g****m 11
Patrik Reizinger p****r@b****l 9
Patrik Reizinger p****r@b****l 7
Patrik Reizinger p****r@s****l 6
Patrik Reizinger p****r@s****l 6
Patrik Reizinger p****r@s****l 4
Patrik Reizinger p****r@s****l 4
Patrik Reizinger p****r@s****l 3
Patrik Reizinger p****r@s****l 3
Patrik Reizinger p****r@s****l 3
Patrik Reizinger p****r@s****l 2
Patrik Reizinger p****r@s****l 2
Patrik Reizinger p****r@s****l 2
Patrik Reizinger p****r@s****l 2
Patrik Reizinger p****r@s****l 2
Patrik Reizinger p****r@s****l 2
Patrik Reizinger p****r@s****l 2
Patrik Reizinger p****r@b****l 1
Patrik Reizinger p****r@s****l 1
Patrik Reizinger p****r@s****l 1
Patrik Reizinger p****r@s****l 1
Patrik Reizinger p****r@s****l 1
Patrik Reizinger p****r@s****l 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 2
  • Total pull requests: 8
  • Average time to close issues: 3 days
  • Average time to close pull requests: about 1 hour
  • Total issue authors: 2
  • Total pull request authors: 1
  • Average comments per issue: 1.5
  • Average comments per pull request: 0.0
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • yplusble (1)
  • rmwu (1)
Pull Request Authors
  • rpatrik96 (8)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/python-package.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
care_nl_ica/cl_ica/docker/Dockerfile docker
  • nvidia/cuda 10.0-cudnn7-devel-ubuntu16.04 build
requirements.txt pypi
  • functorch *
  • h5py *
  • hydra-core *
  • jsonargparse *
  • matplotlib *
  • numpy *
  • omegaconf *
  • pandas *
  • pip *
  • pre-commit *
  • pynvml *
  • pytest *
  • pytorch-lightning ==1.5.10
  • scikit-learn *
  • scipy *
  • setuptools *
  • torch *
  • torchmetrics *
  • tueplots *
  • wandb *
tests/requirements.txt pypi
  • black * test
  • check-manifest * test
  • codecov * test
  • coverage * test
  • flake8 * test
  • pytest * test
  • pytest-cov * test
  • pytest-flake8 * test
  • twine ==1.13.0 test
setup.py pypi