ml-pytorch-geometric

Build graph neural networks with PyTorch Geometric for node and graph classification.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/nishide-dev/claude-code-ml-research --skill ml-pytorch-geometric
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ml-pytorch-geometric
Source: https://github.com/nishide-dev/claude-code-ml-research/tree/main/skills/ml-pytorch-geometric
Command: npx skills add https://github.com/nishide-dev/claude-code-ml-research --skill ml-pytorch-geometric

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you learn and apply PyTorch Geometric (PyG) to build Graph Neural Networks (GNNs) for real graph data problems without getting stuck on the framework’s data model and training patterns.

Core Features & Use Cases

  • Graph data modeling: Convert your dataset into PyG Data objects (node features, edge_index, targets) and handle batching via batch.
  • Message passing & GNN layers: Implement and reason about the message/aggregate/update flow and choose common layers like GCNConv, GATConv, and SAGEConv.
  • Scalable training workflows: Use neighbor sampling (NeighborLoader) and distributed/out-of-core concepts for large graphs.
  • Task coverage: Support node classification, graph classification, heterogeneous graphs (HeteroData), and explainability patterns.
  • Lightning integration: Use Lightning-compatible dataset wrappers such as LightningDataset and LightningNodeData to streamline training.

Quick Start

Tell the AI: "Show me how to structure a node-classification GNN in PyTorch Geometric with Lightning, including how to prepare edge_index, masks, and a neighbor-sampling datamodule."

Frequently Asked Questions about ml-pytorch-geometric

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

FAQPage Schema
How do I build a graph neural network in PyTorch Geometric for node classification?

To build a graph neural network for node classification in PyTorch Geometric, structure your data as a PyG Data object with node features, edge_index, and targets, then apply message passing layers like GCNConv to propagate node embeddings across the graph topology.

What is the best way to handle heterogeneous graphs in PyTorch Geometric?

Heterogeneous graphs in PyTorch Geometric are handled using the HeteroData construct, which organizes distinct node and edge types into separate feature dictionaries while applying dedicated message passing modules to route and aggregate type-specific graph relationships.

How does neighbor sampling work for training large graph neural networks?

Neighbor sampling for large graph neural networks uses NeighborLoader to extract localized subgraphs around target nodes during training, enabling scalable mini-batch processing and distributed out-of-core learning without loading the full sparse adjacency matrix into memory.

Can I use PyTorch Lightning to manage distributed training for PyTorch Geometric models?

Yes, you can use PyTorch Lightning to manage distributed training for PyTorch Geometric models by wrapping datasets with LightningDataset or LightningNodeData, which streamline training loops and integrate scalable neighbor sampling directly into Lightning datamodules.

Why does my PyTorch Geometric model expect specific tensor shapes for edge_index and batch vectors?

PyTorch Geometric models require correct tensor shapes for edge_index and batch vectors because the framework uses these specific dimensions to properly route messages, aggregate sparse adjacency data, and combine multiple disjoint graphs into a single batched representation.

What are the limitations of message passing layers on extremely sparse graph data?

Message passing layers on extremely sparse graph data face memory bottlenecks when scaling to large graphs, requiring neighbor sampling and distributed out-of-core concepts to prevent excessive memory consumption during aggregate and update operations on massive sparse adjacency matrices.