Graph Neural Networks in TensorFlow and Keras with Spektral
Abstract
In this paper we present Spektral, an open-source Python library for building graph neural networks with TensorFlow and the Keras application programming interface. Spektral implements a large set of methods for deep learning on graphs, including message-passing and pooling operators, as well as utilities for processing graphs and loading popular benchmark datasets. The purpose of this library is to provide the essential building blocks for creating graph neural networks, focusing on the guiding principles of user-friendliness and quick prototyping on which Keras is based. Spektral is, therefore, suitable for absolute beginners and expert deep learning practitioners alike. In this work, we present an overview of Spektral's features and report the performance of the methods implemented by the library in scenarios of node classification, graph classification, and graph regression.
Benchmark Results
Tested on 2 datasets
Tables show presented results in global context (best 3 papers + GCN + MLP).
TU Dortmund
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | MSH-GNN | 0.9910
±0.0030 | |
| 2 | ID-GNN+BEC | 0.9830
±0.0360 | |
| 3 | SupCosine | 0.9830
±0.0250 | |
| 39 | GIN | 0.9330
±0.0290 | |
| 239 | DiffPool | 0.8940
±0.0460 best reported | best at pub: Fast Graph Representation Learning with PyTorch Geometric (ICLR 2019) best today: Graph Classification via Reference Distribution Learning: Theory and Practice (NeurIPS 2024) Difference within reported uncertainty; not counted as underperformance. |
| 403 | MLP | 0.8660
±0.0495 | |
| 583 | MinCut | 0.8140
±0.1070 | This paper |
| 623 | SAGPool | 0.7986
±0.0236 best reported | best today: Embedding Graphs on Grassmann Manifold (2022) Difference within reported uncertainty; not counted as underperformance. |
| 641 | Top-k | 0.7920
±0.0800 | This paper |
| 748 | Flat | 0.7250
±0.1400 | This paper |
| # | Model | Accuracy ↑ | Paper |
|---|---|---|---|
| 1 | WL-MLP | 0.9954 | |
| 2 | GIN | 0.9934 | |
| 3 | GCN | 0.9727 | |
| 5 | DiffPool | 0.9210
±0.0260 best reported | best today: Where to Mask: Structure-Guided Masking for Graph Masked Autoencoders (IJCAI 2024) |
| 131 | GraphSAGE | 0.8200
±0.0100 | |
| 221 | MinCut | 0.8010
±0.0260 best reported | best today: The expressive power of pooling in Graph Neural Networks (NeurIPS 2023) |
| 259 | SAGPool | 0.7910
±0.0300 best reported | best today: The expressive power of pooling in Graph Neural Networks (NeurIPS 2023) Difference within reported uncertainty; not counted as underperformance. |
| 345 | Flat | 0.7730
±0.0260 | This paper |
| 457 | Top-k | 0.7260
±0.0310 best reported | best today: The expressive power of pooling in Graph Neural Networks (NeurIPS 2023) Difference within reported uncertainty; not counted as underperformance. |
