Source-linked AI summary

PyTorch Geometric Temporal: Spatiotemporal Signal Processing with Neural Machine Learning Models

Benedek Rozemberczki, Paul Scherer, Yixuan He, George Panagopoulos, Alexander Riedel, Maria Astefanoaei, Oliver Kiss, Ferenc Beres, Guzmán López, Nicolas Collignon, Rik Sarkar

arXiv:2104.07788v3cs.LGcs.AIcs.SI

TL;DR

PyTorch Geometric Temporal addresses the limited support for changing spatiotemporal graph data in existing geometric deep learning frameworks. It provides a unified open-source library with temporal data handling, reusable models, and benchmark datasets, and evaluates the framework across real-world forecasting tasks and scalability experiments.

  • Problem

    Existing geometric deep learning frameworks operate on graphs with fixed topology, while temporal geometric deep learning requires spatiotemporal machine learning support.

  • Method

    The paper presents an open-source Python library that combines modular neural and parametric models, temporal signal iterators, data loaders, and spatiotemporal benchmark datasets.

  • Results

    The framework's models are evaluated on real-world epidemiological, demand-planning, web-traffic, and social-media interaction prediction tasks, while synthetic experiments show scalability with suitable batching and GPU acceleration.

  • Takeaways & Limitations

    PyTorch Geometric Temporal makes temporal geometric deep learning available through a unified framework for researchers and machine learning practitioners.

  • Takeaways & Limitations

    The framework does not yet address continuous time or nonconstant intervals between snapshots, or temporal models operating on curved spaces.

Abstract

from arXiv · show

We present PyTorch Geometric Temporal a deep learning framework combining state-of-the-art machine learning algorithms for neural spatiotemporal signal processing. The main goal of the library is to make temporal geometric deep learning available for researchers and machine learning practitioners in a unified easy-to-use framework. PyTorch Geometric Temporal was created with foundations on existing libraries in the PyTorch eco-system, streamlined neural network layer definitions, temporal snapshot generators for batching, and integrated benchmark datasets. These features are illustrated with a tutorial-like case study. Experiments demonstrate the predictive performance of the models implemented in the library on real world problems such as epidemiological forecasting, ridehail demand prediction and web-traffic management. Our sensitivity analysis of runtime shows that the framework can potentially operate on web-scale datasets with rich temporal features and spatial structure.

1 INTRODUCTION

PyTorch Geometric Temporal addresses the fixed-topology focus of existing geometric deep learning frameworks by providing an open-source library for spatiotemporal machine learning. It combines modular PyTorch-based components, temporal data handling, benchmark datasets, and evaluations across real-world forecasting tasks.

  • Existing geometric deep learning frameworks primarily operate on graphs with fixed topology, motivating support for spatiotemporal machine learning.
  • PyTorch Geometric Temporal is proposed as an open-source Python library with a simple, consistent API for spatiotemporal machine learning.
  • The framework reuses neural network layers modularly and provides memory-efficient temporal signal iterators compatible with PyTorch.
  • Experiments evaluate spatiotemporal graph neural networks on epidemiological forecasting, demand planning, web traffic management, and social media interaction prediction.
  • With an appropriate batching strategy, synthetic experiments find the framework highly scalable and beneficial from GPU-accelerated computing.
  • The library releases data loaders, temporal iterators, and new benchmark datasets spanning renewable energy, epidemiology, goods delivery, and web traffic forecasting.

2 PRELIMINARIES AND RELATED WORK

The paper frames spatiotemporal learning through discrete temporal graph snapshots and positions its framework among geometric deep learning and spatiotemporal software libraries. It emphasizes GPU-accelerated supervised temporal graph learning as a distinctive capability.

  • 2.1 Temporal Graph Sequences: Spatiotemporal data are represented as discrete temporal snapshots whose graph structure and node attributes may vary independently.The framework distinguishes dynamic graphs with temporal signals, dynamic graphs with static signals, and static graphs with temporal signals.
  • 2.1 Temporal Graph Sequences: These three data types support memory-efficient data structures that operationalize the corresponding theoretical definitions.
  • 2.2 Spatiotemporal Deep Learning: Spatiotemporal deep learning combines graph message passing at each time point with temporal modeling to share spatial and temporal autocorrelation information.Graph and temporal layers are trained jointly in a single parametric model.
  • 2.3 Graph Representation Learning Software: The framework extends the PyTorch Geometric ecosystem with supervised temporal graph representation learning and graphics-card-based acceleration.The paper presents this combination as unavailable in the compared geometric deep learning libraries.
  • 2.3 Graph Representation Learning Software: PyTorch Geometric Temporal compares spatiotemporal models by their temporal and spatial blocks, proximity order, and edge heterogeneity.
  • 2.4 Spatiotemporal Data Analytics Software: The paper identifies limited GPU acceleration in existing spatiotemporal tools and presents PyTorch Geometric Temporal as a fully open-source GPU-accelerated spatiotemporal machine learning library.

3 THE FRAMEWORK DESIGN

The framework is designed to provide a theoretical overview, explain its design choices, demonstrate practical use, and support long-term project viability and maintenance.

  • The framework’s design section covers its theoretical foundations, design choices, practical example, and strategy for long-term viability and maintenance.

3.1 Neural Network Layer Design

The framework implements spatiotemporal neural network layers as simple, modular classes built on the PyTorch ecosystem. Its design favors interoperability, inspectability, and a small public interface.

  • Spatiotemporal neural network layers are implemented as classes following a shared architecture and a few simple design principles.
  • Existing PyTorch and PyTorch Geometric layers serve as modular building blocks rather than being replaced.This keeps auxiliary classes few and preserves interoperability with the ecosystem.
  • Layer hyperparameters are public and inspectable, while type-hinted constructors help users configure dataset-dependent settings.
  • Layers expose limited public methods for simplicity, generally providing forward and, where applicable, message.Auxiliary initialization and internal mechanics remain private.
  • Auxiliary layers absent from PyTorch Geometric, including diffusion convolutional graph neural networks, are implemented as standalone reusable components.

3.2 Data Structures

The framework introduces memory-efficient temporal data structures and iterators that return ordered graph snapshots in PyTorch Geometric-compatible formats. It also supplies loaders and temporal train-test splitting for supervised workflows.

  • Custom data structures store datasets efficiently and provide temporally ordered snapshots for batching.
  • Three iterator types represent the paper’s spatiotemporal signal categories while avoiding redundant storage, such as repeated static edges.Each iteration returns a graph snapshot for a specific time point.
  • Time-specific labels, features, edge indices, and weights are stored as NumPy arrays and returned as PyTorch Geometric Data objects.This uses compact ecosystem data structures and limits class proliferation.
  • Temporal train-test splitting separates a specified fraction from the end of the snapshot sequence and preserves the input iterator type.
  • Dataset loaders return Spatiotemporal Signal Iterators for training existing or custom spatiotemporal neural network architectures.

3.3 Design in Practice Case Study: Cumulative Model Training on CPU

The case study builds an end-to-end epidemiological forecasting pipeline that loads and temporally splits benchmark data, defines a recurrent graph convolutional model, trains it over snapshots, and evaluates mean squared error.

  • The pipeline predicts weekly chickenpox cases in Hungary through data preparation, model definition, training, and evaluation phases.
  • Dataset Loading and Splitting: The dataset loader returns a temporal signal iterator, and the split retains 10% of temporal snapshots for evaluation.
  • Model Definition: The recurrent graph convolutional model combines a one-hop diffusion convolutional recurrent layer with a single-neuron fully connected layer.
  • Model Definition: During the forward pass, vertex features, edges, and optional edge weights are aggregated, followed by ReLU, dropout, and a score for each spatial unit.
  • Training: Training iterates over temporal snapshots, accumulates spatial-unit mean squared errors, normalizes the cost, and backpropagates updates.
  • Evaluation: Evaluation runs forward passes over test snapshots and reports mean squared error averaged across the whole test horizon.

3.4 Design in Practice Case Study: Incremental Model Training with GPU Acceleration

The GPU case study transfers the recurrent graph model and temporal snapshots to a CUDA device for incremental training and accelerated evaluation. It also notes that per-time-step weight updates are slower than epoch-end updates.

  • Setup: The GPU workflow assumes the dataset is loaded, the temporal split is complete, the model is defined, and one CUDA-compatible GPU is available.
  • Incremental Training: The training example transfers the model and each PyTorch Geometric Data snapshot to the GPU while iterating over temporal snapshots for 200 epochs.
  • Incremental Training: Incremental weight updates are slower because weights are updated at each time step rather than only at the end of training epochs.
  • Evaluation: GPU evaluation requires transferring test snapshots to the device before forward passes, loss accumulation, averaging, and detachment for printing.

3.5 Maintaining PyTorch Geometric Temporal

The project’s long-term maintenance relies on open-source collaboration, public releases, automated documentation, continuous integration, and extensive testing. These practices support installation, documentation, and verification across multiple operating systems.

  • Open-source code, version control, public releases, automatically generated documentation, continuous integration, and near 100% test coverage support project viability.
  • Open-Source Distribution: The MIT-licensed source code is publicly available on GitHub, while releases are distributed through the Python Package Index for pip installation.
  • Documentation: Automatically generated documentation covers neural layers, temporal iterators, dataset loaders, splitters, installation, tutorials, and benchmark datasets.
  • Continuous Integration: GitHub Actions triggers builds on repository updates and deploys the library across Linux, Windows, and macOS virtual machines.
  • Testing: Unit tests cover temporal graph neural network layers, custom data structures, and benchmark dataset loaders, with continuous-integration coverage reporting.

4 EXPERIMENTAL EVALUATION

The evaluation releases and tests spatiotemporal benchmark datasets on node-level regression tasks, comparing recurrent graph neural networks and backpropagation regimes while measuring runtime scalability. Results show broadly similar predictive performance across models, a dataset-dependent advantage for incremental training, marginal cumulative-runtime gains, and roughly tenfold GPU speedups on large dynamic graphs.

  • 4.1 Datasets: The framework introduces spatiotemporal benchmark datasets for node-level regression across epidemiological, energy, delivery, web-traffic, social-media, and hand-motion domains.The datasets vary in temporal granularity and spatial structure, including county graphs, windmill proximity graphs, linked Wikipedia pages, Twitter mention graphs, and hand-keypoint graphs.
  • 4.2 Experimental settings.: The forecasting evaluation compares recurrent graph neural networks under incremental and cumulative backpropagation regimes.Incremental updates weights after each temporal snapshot, whereas cumulative aggregation performs one optimizer update per epoch.
  • 4.2.2 Experimental findings.: Most recurrent graph neural networks show similar predictive performance, with no single model acting as a universal best choice.The findings suggest training time may help distinguish models when predictive performance is comparable.
  • 4.2.2 Experimental findings.: On Wikipedia Math, cumulative backpropagation can harm predictive performance, while incremental training can be significantly better when computation is available.This result is dataset-specific rather than a universal ranking of the two regimes.
  • 4.3.2 Experimental findings.: Cumulative backpropagation provides only marginal computational gains over incremental training.Runtime was evaluated over synthetic Watts-Strogatz graph sequences using the GConvGRU model and reported across ten experimental runs.
  • 4.3.2 Experimental findings.: GPU-aided training can reduce epoch time by a whole magnitude on temporal sequences of large dynamically changing graphs.The runtime comparison used CPU and Tesla V-100 GPU hardware under the described synthetic-graph setup.

5 CONCLUSIONS AND FUTURE DIRECTIONS

The paper presents PyTorch Geometric Temporal as a deep learning library for neural spatiotemporal signal processing and evaluates its predictive performance and scalability. Future work includes irregular continuous-time modeling, curved-space temporal models, and applications to high-impact machine learning tasks.

  • 5 CONCLUSIONS AND FUTURE DIRECTIONS: PyTorch Geometric Temporal is presented as a deep learning library for neural spatiotemporal signal processing.The paper discusses its framework design, data structures, implemented techniques, and practical case study.
  • 5 CONCLUSIONS AND FUTURE DIRECTIONS: The empirical evaluation covers model predictive performance on released real-world datasets and scalability across varied input sizes and structures.These two evaluation dimensions form the paper’s stated empirical focus.
  • 5 CONCLUSIONS AND FUTURE DIRECTIONS: Future extensions include continuous time or nonconstant snapshot intervals and temporal models operating in hyperbolic or spherical spaces.The authors also identify deployment on high-impact practical machine learning tasks as an opportunity.
Loading 2104.07788v3…