torch-geometric

Build and train Graph Neural Networks on graph-structured data with PyTorch.

Updated Dec 8, 2025
One-click install
npx skills add https://github.com/Tianyi-Billy-Ma/PyTemplate --skill torch-geometric
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: torch-geometric
Source: https://github.com/Tianyi-Billy-Ma/PyTemplate/tree/main/.dev/ai/skills/skills/torch-geometric
Command: npx skills add https://github.com/Tianyi-Billy-Ma/PyTemplate --skill torch-geometric

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, torch-geometric, numpy, and includes scripts (resource) and references (resource) components.

What problem does it solve?

PyTorch Geometric (PyG) provides a rich library and tutorials for building, training, and deploying Graph Neural Networks on graphs, heterographs, and point clouds.

Core Features & Use Cases

  • GNN primitives: GCConv, GATConv, GraphSAGE, GIN, TransformerConv, and more
  • Diverse tasks: Node classification, graph classification, link prediction, molecular property prediction
  • Datasets & templates: Built-in datasets and boilerplates for common GNN architectures

Quick Start

Install PyG and run one of the included scripts (e.g., train a simple GCN on Cora using the templates in scripts/). Adapt to your own dataset.

Frequently Asked Questions about torch-geometric

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build and train graph neural networks on graph-structured data?▼

Graph neural networks enable learning on graph-structured data using layers like GCN, GAT, and GraphSAGE. PyTorch Geometric provides pre-built GNN layers, standard data objects (node features, edge indices, labels), and mini-batch processing to train models for node classification, graph classification, link prediction, and molecular property prediction tasks.

What GNN architectures and layers does PyTorch Geometric support?▼

PyTorch Geometric includes GCNConv, GATConv, GraphSAGE, GINConv, TransformerConv, and ChebConv layers. These primitives cover attention-based, spatial, and spectral approaches, enabling flexible architecture design for diverse graph learning tasks from citation networks to 3D point clouds.

Can I train graph neural networks on multiple GPUs with PyTorch Geometric?▼

Yes. PyTorch Geometric integrates with PyTorch's multi-GPU training capabilities. The library supports mini-batch processing and standard PyTorch data objects, allowing distributed training across GPUs for large-scale graph datasets.

How do I prepare and format graph data for PyTorch Geometric models?▼

PyTorch Geometric uses standard Data objects with node features (x), edge indices (edge_index), edge attributes (edge_attr), and labels (y). The library includes built-in datasets for common benchmarks and templates in scripts/ to adapt your own graph data.

What types of graph learning tasks can PyTorch Geometric handle?▼

PyTorch Geometric supports node classification, graph classification, link prediction, molecular property prediction, social and citation network analysis, and 3D geometric data processing. Pre-built architectures and datasets accelerate implementation for these common tasks.