torch-geometric

Design, train, and optimize Graph Neural Networks with PyTorch Geometric.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/HaykTarkhanyan/dst_research --skill torch-geometric-hayktarkhanyan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: torch-geometric
Source: https://github.com/HaykTarkhanyan/dst_research/tree/main/.claude/skills/torch-geometric
Command: npx skills add https://github.com/HaykTarkhanyan/dst_research --skill torch-geometric-hayktarkhanyan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PyG enables rapid development and experimentation of Graph Neural Networks using PyTorch Geometric, providing a rich set of data structures, models, and training utilities to bridge graph data and ML workflows.

Core Features & Use Cases

  • Data modeling with Data and HeteroData for homogeneous and heterogeneous graphs
  • 60+ GNN layers, transforms, sampling strategies, and scalable loaders
  • End-to-end guidance for node classification, graph classification, and link prediction
  • Heterogeneous graph support (types, relations) and auto-conversion tools
  • Explainability and common pitfalls guidance for PyG workflows

Quick Start

Import torch_geometric, load a small dataset (e.g., Cora) and run a basic two-layer GCN to observe initial results.

Frequently Asked Questions about torch-geometric

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

FAQPage Schema
How do I build a Graph Neural Network for node classification using PyTorch Geometric?

To build a Graph Neural Network for node classification, use PyTorch Geometric's Data structures to load datasets like Cora, then construct a model such as a two-layer GCN to train, evaluate, and predict node labels.

What is the correct edge_index format for graph data structures in PyTorch Geometric?

The correct edge_index format for graph data structures in PyTorch Geometric is a tensor of shape [2, num_edges] defining source and target nodes. Correct formatting is essential to avoid common pitfalls during GNN execution.

Does PyTorch Geometric support heterogeneous graphs with different node and edge types?

Yes, PyTorch Geometric supports heterogeneous graphs using the HeteroData container. It handles distinct node and edge types, provides auto-conversion tools, and enables GNN training across complex relational schemas.

How do I scale Graph Neural Network training for large graphs using neighbor sampling?

To scale Graph Neural Network training for large graphs, apply PyTorch Geometric's neighbor sampling strategies and scalable loaders. This enables mini-batch training on massive graphs without loading the entire topology into memory.

Can I perform link prediction and graph classification end-to-end with PyTorch Geometric?

Yes, you can perform link prediction and graph classification end-to-end with PyTorch Geometric. It provides specialized GNN layers, transforms, and training utilities to handle these specific graph machine learning tasks.

What are common pitfalls when designing GNNs with PyTorch Geometric?

Common pitfalls when designing GNNs with PyTorch Geometric include incorrect edge_index formatting, improper handling of heterogeneous graph relations, and overlooking scalability constraints. The Skill provides guidance to enforce correct API patterns and explainability.