Introducing DIG: Dive into Graphs
DIG: Dive into Graphs is a cutting-edge library designed to facilitate research in graph deep learning. It provides researchers with a comprehensive toolkit to explore and advance in various graph-related tasks.
Why Choose DIG?
Unlike other graph deep learning libraries such as PyTorch Geometric (PyG) and Deep Graph Library (DGL), DIG stands out by offering a unified platform for higher-level, research-focused tasks. These tasks include graph generation, self-supervised learning, explainability, 3D graphs, and graph out-of-distribution scenarios. DIG's framework allows researchers to develop their own methodologies and benchmark them against prevailing baseline methods effortlessly.
Key Features
DIG incorporates unified implementations of data interfaces, common algorithms, and evaluation metrics to simplify the implementation and benchmarking of new algorithms. It currently covers several research directions including:
- Graph Generation: Tools and libraries available under
dig.ggraph
. - Self-supervised Learning on Graphs: Resources found in
dig.sslgraph
. - Explainability of Graph Neural Networks: Explained through
dig.xgraph
. - Deep Learning on 3D Graphs: Managed via
dig.threedgraph
. - Graph Out-of-Distribution: Supported by
dig.oodgraph
. - Graph Augmentation: Available in
dig.auggraph
. - Fair Graph Learning: Developed under
dig.fairgraph
.
Usage Example
Getting started with DIG is straightforward. For instance, the following example illustrates how to use the SphereNet model on the QM9 dataset to integrate 3D molecular data:
from dig.threedgraph.dataset import QM93D
from dig.threedgraph.method import SphereNet
from dig.threedgraph.evaluation import ThreeDEvaluator
from dig.threedgraph.method import run
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']]
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()
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)
Getting Started
For those interested in exploring DIG further, there are detailed tutorials, examples, and documentation available to guide you through various graph deep learning processes.
- Documentation: Comprehensive guides can be found here.
- Tutorials: Step-by-step instructions for different tasks.
- Examples: Ready-made code examples to demonstrate DIG's capabilities in various tasks.
Installation
DIG requires PyTorch (>=1.10.0), PyTorch Geometric (>=2.0.0), and RDKit. It can be installed via pip and directly from the source. Detailed installation instructions are available to ensure a smooth setup process.
Community and Support
DIG's team at DIVE, Texas A&M University, welcomes contributions and community involvement. Should you have technical questions or suggestions, you can reach out through the DIG Slack community or contact the project leads via email.
DIG provides an excellent opportunity for researchers involved in graph deep learning to accelerate their research with an adaptable and resource-rich library.