Coder Social home page Coder Social logo

diffan's Introduction

DiffAN

Code for the paper "Diffusion Models for Causal Discovery via Topological Ordering".

Running code

See example of how to use DiffAN class in demo_DiffAN.py. Once an instance diffan_obj of DiffAN is created, diffan_obj.fit() will

  • train the diffusion model,
  • run topological ordering and,
  • perform pruning of spurious edges.

The output is the adjacency matrix of the causal graph.

Hyperparameters

Most hyperaparameters are hard-coded into constructor of the DiffAN class and we verified they work across a wide set of datasets.

However, as decribed in the paper, there is an approximation of DiffAN referred to as "DiffAN Masking" that has better scaling laws while maintaining similar performance. Setting the residue to False in

diffan = DiffAN(n_nodes, residue = False)

will use the approximation.

Install Requirements

The repo use python and R code. To install the python dependencies, run:

conda env create -f environment.yml

The most important python dependencies are numpy, torch and functorch which can be easily installed manually if one prefer not to use conda. cdt is needed for using the R pruning code. If the R dependencies are not installed, some of the pruning functions won't work. In this case, we advise to open an R session and install the specific packages from R directly.

diffan's People

Contributors

sanches-pedro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.