Package: dive-into-graphs
Documentation|Paper [JMLR]|Tutorials|Benchmarks|Examples|Join the DIG slack community now!:fire:DIG: Dive into Graphsis a turnkey library for graph deep learning research.:fire: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.OverviewIt includes unified implementations ofdata interfaces,common algorithms, andevaluation metricsfor 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.ggraphSelf-supervised Learning on Graphs:dig.sslgraphExplainability of Graph Neural Networks:dig.xgraphDeep Learning on 3D Graphs:dig.threedgraphGraph OOD:dig.oodgraphUsageExample: a few lines of code to runSphereNetonQM9to incorporate 3D information of molecules.fromdig.threedgraph.datasetimportQM93Dfromdig.threedgraph.methodimportSphereNetfromdig.threedgraph.evaluationimportThreeDEvaluatorfromdig.threedgraph.methodimportrun# Load the dataset and splitdataset=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 evaluationmodel=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 evaluaterun3d=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)For details of all included APIs, please refer to thedocumentation.We provide a hands-on tutorial for each direction to help you to get started withDIG:Graph Generation,Self-supervised Learning on Graphs,Explainability of Graph Neural Networks,Deep Learning on 3D Graphs,Graph OOD (GOOD) datasets.We also provideexamplesto use APIs provided inDIG. You can get started with your interested directions by clicking the following links.Graph Generation:JT-VAE,GraphAF,GraphDF,GraphEBM.Self-supervised Learning on Graphs:InfoGraph,GRACE,MVGRL,GraphCL,LaGraph (v1 supported).Explainability of Graph Neural Networks:DeepLIFT,GNN-LRP,FlowX,GNNExplainer,GradCAM,PGExplainer,SubgraphX.Deep Learning on 3D Graphs:SchNet,DimeNet++,SphereNet.Graph OOD (GOOD) datasets:GOODHIV,GOODPCBA,GOODZINC,GOODCMNIST,GOODMotif,GOODCora,GOODArxiv,GOODCBAS.InstallationInstall from pipThe key dependencies of DIG: Dive into Graphs are PyTorch (>=1.10.0), PyTorch Geometric (>=2.0.0), and RDKit.InstallPyTorch(>=1.10.0)$python-c"import torch; print(torch.__version__)">>>1.10.0InstallPyG(>=2.0.0)$python-c"import torch_geometric; print(torch_geometric.__version__)">>>2.0.0Install DIG: Dive into Graphs.pipinstalldive-into-graphsAfter installation, you can check the version. You have successfully installed DIG: Dive into Graphs if no error occurs.$python
>>>fromdig.versionimport__version__
>>>print(__version__)Install from sourceIf you want to try the latest features that have not been released yet, you can install dig from source.gitclonehttps://github.com/divelab/DIG.gitcdDIG
pipinstall.ContributingWe welcome any forms of contributions, such as reporting bugs and adding new features. Please refer to ourcontributing guidelinesfor details.Citing DIGPlease cite ourpaperif you findDIGuseful 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 TeamDIG: Dive into Graphsis developed byDIVE@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.ContactIf you have any technical questions, please submit new issues or raise it in ourDIG slack community:fire:.If you have any other questions, please contact us: Meng Liu [mengliu@tamu.edu] and Shuiwang Ji [sji@tamu.edu].