Giter VIP home page Giter VIP logo

graphde's Introduction

GraphDE

Official implementation for our paper:

GraphDE: A Generative Framework for Debiased Learning and Out-of-Distribution Detection on Graphs

Zenan Li, Qitian Wu, Fan Nie, Junchi Yan* (* denotes correspondence)

Advances in Neural Information Processing Systems (NeurIPS 2022)

Overview

GraphDE is a plug-in module to tackle two critical but largely unexplored problems for graph data: debiased learning and OOD detection.

In this paper, we find the fundamental correlations between these two problems and define them under a probabilistic framework.

We model the generative process to characterize the distribution shifts of graph data, along with an environment variable as an indicator. Utilizing variational inference, we propose to infer the environment variable during the training procedure of GNN. The induced learning objective enables us to solve these two problems simultaneously.

GraphDE_Framework

Environment

  • Main packages: Python 3.8, PyTorch 1.10.0, PyTorch-Geometric 2.1.0.
  • See requirements.txt for other packages.

Dataset

  • Spurious-Motif: this dataset can be generated via spmotif_gen/spmotif.py. Note that you need to generate ID SPMotif-{bias}, OOD mixed SPMotif-mixed-{bias} and OOD testing files SPMotif-ood-{bias} according to our paper to run the code.
  • Collab: this dataset will be automatically downloaded during training.
  • MNIST-75sp: this dataset can be downloaded here. Download mnist_75sp_train.pkl, mnist_75sp_test.pkl, and mnist_75sp_color_noise.pt to the directory data/MNISTSP/raw/.
  • DrugOOD: this dataset should be generated from the guide in DrugOOD. We use the built-in configuration file, namely, lbap_general_ic50_scaffold.py to generate the dataset.

Run GraphDE

The hyper-parameters used to train GraphDE have been discussed in detail in our paper. Please refer to argparse.ArgumentParser in the training files to set them. We use separate files to train on each dataset.

Notably, the debiased learning and OOD detection procedure are integrated in our pipeline. Simply run python -m train.{dataset}_de (--graphde_a ...) to reproduce results in the paper.

Reference

      @inproceedings{li2022graphde,
      title = {GraphDE: A Generative Framework for Debiased Learning and Out-of-Distribution Detection on Graphs},
      author = {Zenan Li and Qitian Wu and Fan Nie and Junchi Yan},
      booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
      year = {2022}
      }

Acknowledgements

We sincerely thank these repositories: DIR-GNN for its well-implemented pipeline, and GLOD-Issues, GLocalKD which are adopted as our detection baseline.

graphde's People

Contributors

qitianwu avatar emiyalzn 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.