Claude Skill MartBrowse skillsWhat is a Skill?
Back to list

PyTorch Geometric (PyG) Graph Neural Network Assistant

Gives Claude accurate, version-current PyTorch Geometric patterns for node/link/graph tasks, heterogeneous graphs, and large-scale sampling.

Dev & CodingAdvanced33,0303,248AI score 8/10Last updated: Aug 9, 2026

What it does

Loads practical PyG 2.7 expertise into Claude:

  • Correct Data / HeteroData construction and the critical [2, num_edges] COO edge_index convention
  • A decision table for picking conv layers (GCNConv, GATv2Conv, SAGEConv, GINConv, TransformerConv, RGCNConv, HGTConv)
  • Ready-made training patterns for node classification, graph classification (DataLoader + global_mean_pool), and link prediction (RandomLinkSplit, negative sampling)
  • Scaling recipes: NeighborLoader, ClusterLoader, GraphSAINT, DDP notes
  • Three approaches to heterogeneous GNNs: to_hetero(), HeteroConv, native operators
  • Custom layers via MessagePassing with the _i / _j auto-indexing rules
  • Explainability through torch_geometric.explain
  • Eight common pitfalls with fixes

Who it's for

  • ML engineers and researchers building GNNs for recommendations, knowledge graphs, molecules, or fraud detection
  • Teams moving beyond NetworkX analytics into trainable graph models
  • Anyone burned by PyG API churn who wants version-accurate snippets

Examples

  1. "Train a 2-layer GCN on Cora" → full Planetoid loading, masked loss, and evaluation loop.
  2. "Turn my user/movie CSVs into HeteroData and do link prediction" → index mapping, T.ToUndirected(), and LinkNeighborLoader scaffolding.
  3. "My graph won't fit on the GPU" → NeighborLoader config with num_neighbors matched to model depth and correct seed-node slicing.

· · · Install guide · · ·

Install in the Claude app (no terminal)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on Claude Skill Mart.
Copy the skills/torch-geometric folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/torch-geometric/.
When it's done, tell me in one line what this skill can do.

Install with a command instead

git clone https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/sas && mkdir -p ~/.claude/skills && cp -r /tmp/sas/skills/torch-geometric ~/.claude/skills/

This is a third-party skill. Check the source repository before installing.

  1. Open a terminal.
  2. Clone the repo: git clone https://github.com/K-Dense-AI/scientific-agent-skills.git
  3. Create the skills folder: mkdir -p ~/.claude/skills
  4. Copy this skill: cp -r scientific-agent-skills/skills/torch-geometric ~/.claude/skills/ (keep the nested references/ folder — the guide links to it).
  5. Set up Python: pip install torch then pip install torch_geometric (Python 3.10+ and PyTorch 2.6+ required).
  6. Restart Claude Code and ask something like "build a PyG graph classification model" to trigger the skill.