DenseSAGEConv
GraphSAGE's mean neighborhood aggregator in dense-adjacency form, the inductive sample-and-aggregate node embedder.
Graphs and geometry · 10 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Graphs and geometry
- Parameters
- 1.1K
- Operations
- 10
- Framework
- PyTorch
- Recurrent
- No
- Published
- NeurIPS 2017
- Cited by
- 9,516 (as of 18 October 2026)
- Authors
- William L. Hamilton, Rex Ying, Jure Leskovec
- Source
- torch_geometric 2.6.1
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m734
- Graph hash
- 3e87fb937d490d25b011ffea1bd9d11770141fe5d33318cefc533de79ebf966b
- Skeleton hash
- f05c16a9d1c32873ecab742a4fc1ec10277982b76214e0eaab0b57de3c547d75
- Architecture hash
- 7289e1ed3d60be8b50657cbf309523c3ca60a0d023431319ea8cae301b61762f
- Diagram SHA-256
- e0cbaa006b1293c0acf1e14799e56bf8715988825d8bd0d242e3d1671ba1b190
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
GraphSAGE is a general inductive framework for producing node embeddings in large graphs, including for nodes the model never saw during training. Its name is short for SAmple and aggreGatE. Rather than training a separate embedding for each node, it learns a function that builds an embedding by sampling and aggregating features from the node's local neighborhood. That matters because most earlier node embedding methods were transductive and could not naturally generalize to unseen nodes.
At each search depth a node aggregates its neighbors' representations into one vector, concatenates that with its own current representation, and feeds the result through a fully connected layer with a nonlinearity. The paper examines three candidate aggregators: a mean, an LSTM, and a pooling aggregator. The mean aggregator simply takes the elementwise mean of the neighbor vectors and is nearly equivalent to the convolutional propagation rule of the transductive GCN. Concatenating a node's own previous representation with the aggregated neighborhood vector acts as a simple skip connection between search depths and leads to significant gains.
To keep each batch's cost fixed, GraphSAGE uniformly samples a fixed-size set of neighbors instead of using full neighborhoods, drawing fresh samples at each depth. In practice two layers with neighborhood sample sizes of 25 and 10 were enough. The method is tested on three inductive benchmarks, classifying unseen nodes in evolving citation and Reddit graphs and generalizing to entirely unseen protein-protein interaction graphs. The authors' reference code notes that GraphSage is intended for graphs of more than 100,000 nodes, because on smaller graphs the overhead of subsampling starts to outweigh its benefits.
Key idea. GraphSAGE replaces per-node embedding tables with trainable neighborhood aggregators, so embeddings can be generated inductively for nodes and graphs never seen in training.
- GraphSAGE
- SAGEConv
- DenseSAGEConv
- sample and aggregate
- inductive node embedding
- mean aggregator
- Hamilton Ying Leskovec
- PyTorch Geometric
- node classification
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{hamilton2018inductiverepresentationlearninglarge,
title={Inductive Representation Learning on Large Graphs},
author={William L. Hamilton and Rex Ying and Jure Leskovec},
year={2018},
eprint={1706.02216},
archivePrefix={arXiv},
primaryClass={cs.SI},
url={https://arxiv.org/abs/1706.02216},
}