torch-geometric

Train graph neural networks for node and graph classification in PyTorch Geometric.

783|65|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/LeonChaoX/qinyan-academic-skills --skill torch-geometric-leonchaox
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: torch-geometric
Source: https://github.com/LeonChaoX/qinyan-academic-skills/tree/main/skills/09-%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E4%B8%8E%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/torch-geometric
Command: npx skills add https://github.com/LeonChaoX/qinyan-academic-skills --skill torch-geometric-leonchaox

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, torch_geometric, networkx, matplotlib, numpy, argparse, and includes scripts (resource) and references (resource) components.

What problem does it solve?

It helps you design, train, and debug graph neural networks by providing a practical, end-to-end workflow for working with graph-structured data using PyTorch Geometric.

Core Features & Use Cases

  • Graph data representation: Use Data / HeteroData with edge_index, node features (x), optional labels (y), batching (batch), and common custom attributes.
  • Core GNN pipelines: Implement message passing models for node classification, graph classification, and link/edge-related tasks with standard layers like GCN, GAT, GraphSAGE, and GIN.
  • Real-world scenarios: Apply GNNs to citation networks, social/citation graphs, molecular property prediction, heterogeneous knowledge graphs, and large-scale graphs via neighbor sampling patterns.
  • Reusable tooling: Includes bundled Python scripts for benchmarking models, generating GNN templates, and visualizing graph structures and basic graph statistics.

Quick Start

Ask your AI agent to benchmark a GCN on the Cora citation network using the provided benchmarking script with a single run for a quick sanity check.

Frequently Asked Questions about torch-geometric

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

FAQPage Schema
How do I train a graph neural network for node classification on a citation network?

To train a graph neural network for node classification, construct a PyTorch Geometric Data object with edge_index and node features, then apply message passing layers like GCN or GAT to predict node labels on citation networks.

What's the best way to build a GNN model for molecular property prediction?

The best way to build a GNN for molecular property prediction is to represent molecules as molecular graphs using PyTorch Geometric, applying GraphSAGE or GIN layers with graph pooling to predict chemical properties.

Does PyTorch Geometric support heterogeneous graph learning workflows?

Yes, PyTorch Geometric supports heterogeneous graph learning workflows by using the HeteroData object to represent heterogeneous graphs, allowing distinct node and edge types for complex knowledge graph processing.

Can I use mini-batching and neighbor sampling for large-scale graph learning?

Yes, you can use mini-batching and neighbor sampling patterns for large-scale graph learning in PyTorch Geometric to efficiently train GNN models on graphs that exceed memory capacity.

How do I visualize graph structures and basic graph statistics?

You can visualize graph structures and basic graph statistics by using the bundled Python scripts alongside NetworkX and Matplotlib to generate graphical representations of your graph data.

Do I need PyTorch and NetworkX installed to use this graph neural network workflow?

Yes, you need PyTorch and NetworkX installed alongside Torch Geometric, NumPy, and Matplotlib to execute the graph neural network training and graph visualization workflows.