gitmyhub

dgl

Python ★ 14k updated 10mo ago

Python package built to ease deep learning on graph, on top of existing DL frameworks.

A Python library for building and training deep learning models on graph-structured data like social networks and molecules, built on top of PyTorch, MXNet, or TensorFlow.

PythonPyTorchApache MXNetTensorFlowCUDAsetup: hardcomplexity 4/5

DGL (Deep Graph Library) is a Python package that makes it easier to build and train machine learning models that operate on graph-structured data. A graph, in this context, is not a chart but a network of nodes and edges, like a social network where people are nodes and friendships are edges, or a molecule where atoms are nodes and chemical bonds are edges. Many real-world problems are naturally represented this way, and DGL provides the tools to apply modern deep learning techniques to them.

The library sits on top of existing deep learning frameworks, specifically PyTorch, Apache MXNet, and TensorFlow. You bring your preferred framework, and DGL adds a high-performance graph object alongside it that can live on either a CPU or a GPU. At the core of DGL is a message-passing system: nodes and edges can exchange and aggregate information through the graph structure, which is the fundamental operation behind most graph neural network architectures.

For researchers, DGL includes example implementations of many published graph neural network models covering tasks like node classification, link prediction, and graph classification. A command-line tool called DGL-Go lets you train and evaluate well-known models without writing code. For advanced users, DGL supports distributed training across multiple GPUs and multiple machines, with internal optimizations that allow it to scale to graphs with billions of nodes and edges.

The project is used as one of the standard platforms for major graph learning benchmark suites, including the Open Graph Benchmark. Companion packages extend it to specific domains: DGL-LifeSci for biology and chemistry, DGL-KE for knowledge graphs, and Graph4NLP for natural language processing tasks that can be modeled as graphs.

Learning resources include a 120-minute introductory tutorial, a full user guide available in English and Chinese, and a discussion forum. The full README is longer than what was shown.

Where it fits