Code Monkey home page Code Monkey logo

cheukwaylee / dagnn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vthost/dagnn

0.0 0.0 0.0 11.31 MB

A graph neural network tailored to directed acyclic graphs that outperforms conventional GNNs by leveraging the partial order as strong inductive bias besides other suitable architectural features.

License: MIT License

Shell 0.14% C++ 2.19% Python 89.83% C 1.66% R 0.01% CSS 0.04% TeX 1.07% Gnuplot 0.01% Cuda 2.43% Makefile 0.01% HTML 0.31% Batchfile 0.01% Jupyter Notebook 2.00% Cython 0.29%

dagnn's Introduction

DAGNN

A graph neural network tailored to directed acyclic graphs that outperforms conventional GNNs by leveraging the partial order as strong inductive bias besides other suitable architectural features.
Source code for ICLR 2021 paper https://openreview.net/forum?id=JbuYF437WB6.

Installation

  • Tested with Python 3.7, PyTorch 1.5.0, and PyTorch Geometric 1.6.0
  • Set up an Anaconda environment: ./setup.sh
    (set the CUDA variables in the script)
  • Alternatively, install the above and the packages listed in requirements.txt

Overview

  • /dvae
    Basically the experiment code and data from D-VAE. The DAGNN models in this directory contain additional methods to support the decoding loss.
  • /ogb
    Basically the code from the Open Graph Benchmark (OGB). We just added additional data preprocessing steps necessary for DAGNN.
  • /ogbg-code
    Experiment code for TOK and LP experiments over the ogbg-code2 data from OGB. The DAGNN model in this directory, can be considered as the basic implementation of DAGNN.
  • /scripts
    Scripts for running the experiments.
  • /src
    Basic utilities used in all experiments.

OGB Experiments

  • Run ./scripts/ogb_tok.sh or ./scripts/ogb_lp.sh
  • The ogbg-code2 data will be downloaded at first run, set the directory for storage in the scripts ($DATA). We updated the code since the ogbg-code dataset used in the paper is deprecated and not available anymore.
  • By default, the script will run DAGNN over a 15% random subset of ogbg-code2. To change these settings, see the comments in the scripts.

DAG Scoring Experiments

  • The two datasets are Neural Architectures (NA) and Bayesian Networks (BN) in /dvae/data. Since the latter is rather large, we suggest to start with the former.
  • Run ./scripts/na_train.sh [DEVICE_ID] [MODEL] for training and ./scripts/na_eval.sh [DEVICE_ID] [MODEL] [EVALUATION_POINT] for evaluation. And similar for BN.
    [MODEL] can be one of: DAGNN, DAGNN_BN, SVAE_GraphRNN, DVAE_GCN, DVAE_DeepGMG, DVAE, DVAE_BN.
  • For example ./scripts/na_train.sh 0 DAGNN, ./scripts/na_eval.sh 0 DAGNN 100.
  • Note that the learning rates and epoch numbers in the scripts are the ones which we used for DAGNN. The experiment parameters for the D-VAE models and baselines can be found here.

Please leave an issue if you have any trouble running the code or suggestions for improvements.

dagnn's People

Contributors

vthost avatar anonyma2020 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.