torch-geometric

torch-geometric is a skill for Claude Code, Codex from Lord1Egypt/scientific-agent-toolkit. It costs 129 tokens per session (4,281 once invoked), scanned A, a copy of torch-geometric, MIT.

A Python guide for building graph neural networks with PyTorch Geometric, a library that lets machine-learning models learn from connected data such as networks, molecules, or social graphs.

In plain words
What is it for?
Use it for node, link, or whole-graph prediction, including heterogeneous graphs and neighbor sampling.
Why use it?
It helps you choose graph data formats, model layers, and training approaches without piecing together the library’s many graph-specific details.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for node, link, or whole-graph prediction, including heterogeneous graphs and neighbor sampling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lord1egypt/scientific-agent-toolkit/torch-geometric
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Lord1Egypt/scientific-agent-toolkit --skill torch-geometric
Clone the repo
git clone --depth 1 https://github.com/Lord1Egypt/scientific-agent-toolkit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for torch-geometric

README.md
[![agentmods](https://agentmods.dev/badge/skills/lord1egypt/scientific-agent-toolkit/torch-geometric/github.svg)](https://agentmods.dev/skills/lord1egypt/scientific-agent-toolkit/torch-geometric)
Your own site
<a href="https://agentmods.dev/skills/lord1egypt/scientific-agent-toolkit/torch-geometric"><img src="https://agentmods.dev/badge/skills/lord1egypt/scientific-agent-toolkit/torch-geometric/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for torch-geometric

Your own site · 80×15
<a href="https://agentmods.dev/skills/lord1egypt/scientific-agent-toolkit/torch-geometric"><img src="https://agentmods.dev/badge/skills/lord1egypt/scientific-agent-toolkit/torch-geometric.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 129 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,281 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00129 $0.04281
Opus 5 $0.00064 $0.02141
Sonnet 5 $0.00026 $0.00856
Haiku 4.5 $0.00013 $0.00428

Measured 6d ago against content hash 375c1aa1e52d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

torch-geometric scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to torch-geometric — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

scientific-skills/torch-geometric/SKILL.md · 422 lines

How it starts

The opening of the file, as written. The whole thing — 422 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PyTorch Geometric (PyG)

PyG is the standard library for Graph Neural Networks built on PyTorch. It provides data structures for graphs, 60+ GNN layer implementations, scalable mini-batch training, and support for heterogeneous graphs.

Install: uv add torch_geometric (or uv pip install torch_geometric; requires PyTorch). Optional: pyg-lib, torch-scatter, torch-sparse, torch-cluster for accelerated ops.

Core Concepts

Graph Data: Data and HeteroData

A graph lives in a Data object. The key attributes:

from torch_geometric.data import Data

data = Data(
    x=node_features,          # [num_nodes, num_node_features]
    edge_index=edge_index,     # [2, num_edges] — COO format, dtype=torch.long
    edge_attr=edge_features,   # [num_edges, num_edge_features]
    y=labels,                  # node-level [num_nodes, *] or graph-level [1, *]
    pos=positions,             # [num_nodes, num_dimensions] (for point clouds/spatial)
)

edge_index format is critical: it's a [2, num_edges] tensor where edge_index[0] = source nodes, edge_index[1] = target nodes. It is NOT a list of tuples. If you have edge pairs as rows, transpose and call .contiguous():

# If edges are [[src1, dst1], [src2, dst2], ...] — transpose first:
edge_index = edge_pairs.t().contiguous()

For undirected graphs, include both directions: edge (0,1) needs both [0,1] and [1,0] in edge_index.

For heterogeneous graphs, use HeteroData — see the Heterogeneous Graphs section below.

Datasets

PyG bundles many standard datasets that auto-download and preprocess:

from torch_geometric.datasets import Planetoid, TUDataset

# Single-graph node classification (Cora, Citeseer, Pubmed)
dataset = Planetoid(root='./data', name='Cora')
data = dataset[0]  # single graph with train/val/test masks

# Multi-graph classification (ENZYMES, MUTAG, IMDB-BINARY, etc.)
dataset = TUDataset(root='./data', name='ENZYMES')
# dataset[0], dataset[1], ... are individual graphs

Read the full file on GitHub · 422 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 422 lines · 129 tokens per session scan A 375c1aa1e52d

Subscribe to this mod's changes

torch-geometric is a skill published in the GitHub repository Lord1Egypt/scientific-agent-toolkit (3 stars, last pushed 3mo ago), licensed MIT. It adds 129 tokens to every session and 4,281 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to torch-geometric, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

marimo-pair

Work inside the user's live marimo notebook from the code editor: run Python in the same kernel the user does, inspect live notebook state, and commit durable notebook changes through code mode. Use whenever you create, analyze, or improve the user's marimo notebook.

marimo-team/marimo · 57 tokens

alterlab-scikit-learn

Classical machine learning in Python with scikit-learn — algorithms, preprocessing, pipelines, and best-practice reference documentation. Use when working with supervised learning (classification, regression), unsupervised learning (clustering, dimensionality reduction), model evaluation, hyperparameter tuning…

AlterLab-IEU/AlterLab-Academic-Skills · 79 tokens

alterlab-pytorch-lightning

Scalable deep-learning training with PyTorch Lightning — organize PyTorch code into LightningModules, configure Trainers for multi-GPU/TPU, build data pipelines and callbacks, log to W&B or TensorBoard, and run distributed training (DDP, FSDP, DeepSpeed). Use when structuring PyTorch training loops, scaling…

AlterLab-IEU/AlterLab-Academic-Skills · 103 tokens

alterlab-stable-baselines3

Trains single-agent reinforcement learning agents with Stable-Baselines3 — PPO, SAC, DQN, TD3, DDPG, and A2C behind a scikit-learn-like API. Use for standard single-agent RL experiments, quick prototyping, well-documented algorithm implementations on Gymnasium environments, or adding callbacks and evaluation. For…

AlterLab-IEU/AlterLab-Academic-Skills · 109 tokens

dask

Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed…

K-Dense-AI/scientific-agent-skills · 69 tokens

optimize-for-gpu

GPU-accelerates scientific Python on NVIDIA hardware and verifies that the result is correct and faster. Use for CUDA/GPU optimization; CPU-bound NumPy, SciPy, pandas, scikit-learn, NetworkX, scikit-image, vector-search, image-processing, graph, simulation, or file-I/O workloads; CuPy, cuDF, cuML, cuGraph, cuVS…

K-Dense-AI/scientific-agent-skills · 151 tokens