• Stars
    star
    1,840
  • Rank 25,060 (Top 0.5 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created almost 4 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A library for graph deep learning research

logo

PyPI Version Docs Status Build Status codecov Last Commit Contributing License visitors Downloads

Documentation | Paper [JMLR] | Tutorials | Benchmarks | Examples | Colab Demo | slack communityπŸ”₯

DIG: Dive into Graphs is a turnkey library for graph deep learning research.

πŸ”₯Update (2022/07): We have upgraded our DIG library based on PyG 2.0.0. We recommend installing our latest version.

Why DIG?

The key difference with current graph deep learning libraries, such as PyTorch Geometric (PyG) and Deep Graph Library (DGL), is that, while PyG and DGL support basic graph deep learning operations, DIG provides a unified testbed for higher level, research-oriented graph deep learning tasks, such as graph generation, self-supervised learning, explainability, 3D graphs, and graph out-of-distribution.

If you are working or plan to work on research in graph deep learning, DIG enables you to develop your own methods within our extensible framework, and compare with current baseline methods using common datasets and evaluation metrics without extra efforts.

Overview

It includes unified implementations of data interfaces, common algorithms, and evaluation metrics for several advanced tasks. Our goal is to enable researchers to easily implement and benchmark algorithms. Currently, we consider the following research directions.

  • Graph Generation: dig.ggraph
  • Self-supervised Learning on Graphs: dig.sslgraph
  • Explainability of Graph Neural Networks: dig.xgraph
  • Deep Learning on 3D Graphs: dig.threedgraph
  • Graph OOD: dig.oodgraph
  • Graph Augmentation: dig.auggraph
  • Fair Graph Learning: dig.fairgraph

logo

Usage

Example: a few lines of code to run SphereNet on QM9 to incorporate 3D information of molecules.

from dig.threedgraph.dataset import QM93D
from dig.threedgraph.method import SphereNet
from dig.threedgraph.evaluation import ThreeDEvaluator
from dig.threedgraph.method import run

# Load the dataset and split
dataset = QM93D(root='dataset/')
target = 'U0'
dataset.data.y = dataset.data[target]
split_idx = dataset.get_idx_split(len(dataset.data.y), train_size=110000, valid_size=10000, seed=42)
train_dataset, valid_dataset, test_dataset = dataset[split_idx['train']], dataset[split_idx['valid']], dataset[split_idx['test']]

# Define model, loss, and evaluation
model = SphereNet(energy_and_force=False, cutoff=5.0, num_layers=4,
                  hidden_channels=128, out_channels=1, int_emb_size=64,
                  basis_emb_size_dist=8, basis_emb_size_angle=8, basis_emb_size_torsion=8, out_emb_channels=256,
                  num_spherical=3, num_radial=6, envelope_exponent=5,
                  num_before_skip=1, num_after_skip=2, num_output_layers=3)                 
loss_func = torch.nn.L1Loss()
evaluation = ThreeDEvaluator()

# Train and evaluate
run3d = run()
run3d.run(device, train_dataset, valid_dataset, test_dataset, model, loss_func, evaluation,
          epochs=20, batch_size=32, vt_batch_size=32, lr=0.0005, lr_decay_factor=0.5, lr_decay_step_size=15)
  1. For details of all included APIs, please refer to the documentation.
  2. We provide a hands-on tutorial for each direction to help you to get started with DIG: Graph Generation, Self-supervised Learning on Graphs, Explainability of Graph Neural Networks, Deep Learning on 3D Graphs, Graph OOD (GOOD) datasets.
  3. We also provide examples to use APIs provided in DIG. You can get started with your interested directions by clicking the following links.

Installation

Install from pip

The key dependencies of DIG: Dive into Graphs are PyTorch (>=1.10.0), PyTorch Geometric (>=2.0.0), and RDKit.

  1. Install PyTorch (>=1.10.0)
$ python -c "import torch; print(torch.__version__)"
>>> 1.10.0
  1. Install PyG (>=2.0.0)
$ python -c "import torch_geometric; print(torch_geometric.__version__)"
>>> 2.0.0
  1. Install DIG: Dive into Graphs.
pip install dive-into-graphs

After installation, you can check the version. You have successfully installed DIG: Dive into Graphs if no error occurs.

$ python
>>> from dig.version import __version__
>>> print(__version__)

Install from source

If you want to try the latest features that have not been released yet, you can install dig from source.

git clone https://github.com/divelab/DIG.git
cd DIG
pip install .

Contributing

We welcome any forms of contributions, such as reporting bugs and adding new features. Please refer to our contributing guidelines for details.

Citing DIG

Please cite our paper if you find DIG useful in your work:

@article{JMLR:v22:21-0343,
  author  = {Meng Liu and Youzhi Luo and Limei Wang and Yaochen Xie and Hao Yuan and Shurui Gui and Haiyang Yu and Zhao Xu and Jingtun Zhang and Yi Liu and Keqiang Yan and Haoran Liu and Cong Fu and Bora M Oztekin and Xuan Zhang and Shuiwang Ji},
  title   = {{DIG}: A Turnkey Library for Diving into Graph Deep Learning Research},
  journal = {Journal of Machine Learning Research},
  year    = {2021},
  volume  = {22},
  number  = {240},
  pages   = {1-9},
  url     = {http://jmlr.org/papers/v22/21-0343.html}
}

The Team

DIG: Dive into Graphs is developed by DIVE@TAMU. Contributors are Meng Liu*, Youzhi Luo*, Limei Wang*, Yaochen Xie*, Hao Yuan*, Shurui Gui*, Haiyang Yu*, Zhao Xu, Jingtun Zhang, Yi Liu, Keqiang Yan, Haoran Liu, Cong Fu, Bora Oztekin, Xuan Zhang, and Shuiwang Ji.

Contact

If you have any technical questions, please submit new issues or raise it in our DIG slack communityπŸ”₯.

If you have any other questions, please contact us: Meng Liu [[email protected]] and Shuiwang Ji [[email protected]].

More Repositories

1

AIRS

Artificial Intelligence Research for Science (AIRS)
Python
489
star
2

GOOD

GOOD: A Graph Out-of-Distribution Benchmark [NeurIPS 2022 Datasets and Benchmarks]
Python
180
star
3

MoleculeX

Python
159
star
4

lgcn

Python
136
star
5

GraphBP

Official implementation of "Generating 3D Molecules for Target Protein Binding" [ICML2022 Long Presentation]
Python
101
star
6

Noise2Same

Jupyter Notebook
63
star
7

dtn

Python
58
star
8

Non-Local-GNN

Official implementation of "Non-Local Graph Neural Networks" [TPAMI]
Python
21
star
9

vqa-text

Python
19
star
10

deepem3d

MATLAB
17
star
11

LECI

The implementation of "Joint Learning of Label and Environment Causal Independence for Graph Out-of-Distribution Generalization" (NeurIPS 2023)
Python
16
star
12

ATTA

Active Test-Time Adaptation: Theoretical Analyses and An Algorithm [ICLR 2024]
Python
16
star
13

svae

Tensorflow implementation of Spatial VAE via Matrix-Variate Normal Distributions
Python
14
star
14

completion

Python
13
star
15

DIG_storage

Save data or other files for DIG library usage
10
star
16

GPT

Python
9
star
17

Neighbor2Seq

Official implementation of "Neighbor2Seq: Deep Learning on Massive Graphs by Transforming Neighbors to Sequences" [SDM2022]
Python
9
star
18

RMwGGIS

Official implementation of "Gradient-Guided Importance Sampling for Learning Binary Energy-Based Models" [ICLR2023]
Python
9
star
19

msvae

Python
8
star
20

crnn

Python
7
star
21

slep

SLEP: Sparse Learning with Efficient Projections
7
star
22

cgan

Computational Modeling of Cellular Structures Using Conditional Deep Generative Networks
Python
4
star
23

AEANets

AEANets
Python
4
star
24

wsdmcup2022

wsdmcup2022
Python
3
star
25

MoleculeKit

2
star
26

3dem

Code for Cremi Task
2
star
27

cleftnet

cleftnet
2
star
28

bigneuron

Python
1
star
29

VoxelDCN

Python
1
star
30

icnn

Shell
1
star
31

vgg

Implementation of VGG
Python
1
star
32

sensors

Python
1
star
33

divelab

1
star