alterlab-torch-geometric — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited alterlab-torch-geometric (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
PyTorch Geometric is a library built on PyTorch for developing and training Graph Neural Networks (GNNs). Apply this skill for deep learning on graphs and irregular structures, including mini-batch processing, multi-GPU training, and geometric deep learning applications.
This skill should be used when working with:
| Scenario | Use Instead |
|---|---|
| Classical graph algorithms, centrality, shortest paths, or network visualization without learning | alterlab-networkx |
| Social-network-analysis designs (centrality, community detection, ERGMs) for substantive social-science claims | alterlab-sna |
| End-to-end molecular property prediction with MoleculeNet featurizers and pretrained chemistry models | alterlab-deepchem |
| Projects built on TorchDrug's datasets and tasks (GearNet, retrosynthesis, molecule generation) | alterlab-torchdrug |
uv pip install torch_geometric
# Optional compiled ops (neighbor sampling, knn/radius graphs, fps): pick TORCH/CUDA to match your install
uv pip install pyg-lib -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.htmlPyG 2.8 folded torch-cluster and torch-spline-conv into pyg-lib (>= 0.7), so those two packages are no longer needed. NeighborLoader raises ImportError unless pyg-lib (or torch-sparse) is installed; for current PyTorch (2.13/2.14) data.pyg.org publishes only pyg-lib wheels, not torch-scatter/torch-sparse.
Graphs are torch_geometric.data.Data objects: x (node features [N, F]), edge_index (connectivity in COO [2, E]), optional edge_attr, y, pos, and any custom attribute (train_mask, etc.). DataLoader batches multiple graphs into one block-diagonal graph (no padding); a batch vector maps nodes back to their source graph.
Full install/sparse-deps, basic graph creation, benchmark loading, edge-index format, and mini-batching details: references/getting_started.md.
InMemoryDataset, or from CSV(references/datasets_and_loading.md; full catalog in references/datasets_reference.md).
MessagePassing for custom layers (references/building_gnns.md; full layer list in references/layers_reference.md).
(DataLoader + global pooling), or large-scale via NeighborLoader neighbor sampling (references/training_workflows.md).
HeteroData/to_hetero for heterogeneous graphs, transforms,GNNExplainer explainability, hierarchical pooling, GPU, save/load (references/advanced_features.md; transforms catalog in references/transforms_reference.md).
GNNs follow neighborhood aggregation: transform node features → propagate messages along edges → aggregate from neighbors → update representations. PyG ships 40+ conv layers. When choosing one, check its capabilities: SparseTensor support, edge_weight, edge_attr, bipartite, and lazy (-1 channel) initialization. Code for GCN/GAT/GraphSAGE and custom MessagePassing layers (including the _i/_j target/source naming convention) is in references/building_gnns.md.
This skill includes detailed reference documentation:
Data structure, edge-index format, mini-batchingMessagePassing layers, layer capabilitiesInMemoryDataset, loading graphs from CSVUtility scripts are provided in scripts/:
Execute scripts directly or read them for implementation patterns.
Part of the AlterLab Academic Skills suite.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.