This Machine Learning concept is the current idea: keep the same invariant visible across Intuition, Math, Code, Interactive Demo.
Machine Learning
GCN, GraphSAGE, and GAT
GCN, GraphSAGE, and GAT differ by the neighbor operator: fixed normalized smoothing, sampled aggregation, or learned attention over a node's neighborhood.
Concept Structure
GCN, GraphSAGE, and GAT
Start with the picture, metaphor, or geometric mechanism.
Make the objects explicit and connect them with notation.
Mirror the equations with runnable implementation details.
Manipulate the mechanism and watch the idea respond.
Learner Contract
What this page should let you do.
2 prerequisites listed; refresh them before leaning on the math or code.
Explain the mechanism, trace the main notation, and test one prediction in the live demo.
Read the intuition before the notation; the math should name a mechanism you already felt.
Follow this edge after making one prediction here; the next page should reuse the result, not restart the route.
Claim/source review status
Substantive review recorded
1/1 claims have bounded review metadata; still check caveats and source scope.Metadata-derived; review may be AI-assisted. Not a human certification.01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
You already know the message-passing template: a node gathers information from its neighbors, combines it, and updates its representation.
This page asks the next question:
When several neighbors can speak, who gets how much influence?
GCN, GraphSAGE, and GAT are not three unrelated inventions. They are three answers to the neighbor-operator question.
- GCN: use the graph structure to assign fixed normalized coefficients. High-degree neighbors and the focus node are scaled by degree.
- GraphSAGE: sample a neighborhood and aggregate it, often so the same learned rule can be used inductively on unseen nodes.
- GAT: learn attention coefficients over the focus node's neighborhood, so some neighbors can matter more than others for this layer.
The important learning move is to keep the graph fixed. Do not compare the names in the abstract. Put one focus node under all three operators and ask which neighbor gets the strongest path into the updated representation.
That is the whole demo: one graph, focus node 3, and a single prediction about node 5's influence.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
Let be a graph with node-feature matrix
We focus on one target node and its one-hop neighborhood . To compare operators cleanly, define a shared transformed feature
The page's finite demo uses this same for all three operators so the visible difference is which nodes get how much influence, not a hidden difference in learned matrices.
GCN: fixed normalized adjacency
With self-loops, let
A common GCN layer has the propagation form
For a single node , the coefficient from source node into is
The key point: the coefficient is fixed by the graph degrees. It is not learned per edge in this layer.
GraphSAGE: sampled aggregate plus self/root term
GraphSAGE keeps the neighborhood-aggregation idea but emphasizes sampling and inductive aggregation. A simplified mean-aggregator view is
then combines the aggregate with the node's own transformed state:
The demo uses a transparent root blend:
That is not the full GraphSAGE training recipe. It is a finite witness for the operator idea: only sampled neighbors can contribute in that step.
GAT: learned attention over the neighborhood
Graph Attention Networks compute a coefficient for each allowed neighbor:
where is a learned compatibility score computed from transformed node features. The update is an attention-weighted sum:
The key point: the graph still masks which nodes are allowed to speak, but the relative influence inside that neighborhood is learned.
So the comparison is:
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import numpy as np
h = {
"self": np.array([0.2, 0.8]),
"n1": np.array([1.0, 0.1]),
"n4": np.array([-0.4, 0.9]),
"n5": np.array([-0.8, 0.7]),
}
W = np.array([[0.6, -0.3], [0.2, 0.75]])
z = {k: W @ v for k, v in h.items()}
# Focus node 3 has self, n1, n4, n5 in its self-loop neighborhood.
# Self-loop degrees: d_self=4, d_n1=3, d_n4=4, d_n5=3.
gcn = {
"self": 1 / np.sqrt(4 * 4),
"n1": 1 / np.sqrt(4 * 3),
"n4": 1 / np.sqrt(4 * 4),
"n5": 1 / np.sqrt(4 * 3),
}
graphsage = {"self": 0.50, "n1": 0.25, "n4": 0.00, "n5": 0.25}
gat = {"self": 0.15, "n1": 0.11, "n4": 0.28, "n5": 0.46}
def mix(weights):
return sum(weights[k] * z[k] for k in weights)
for name, weights in [("GCN", gcn), ("GraphSAGE", graphsage), ("GAT", gat)]:
print(name, "node-5 coefficient", round(weights["n5"], 3),
"output", np.round(mix(weights), 3))
This code intentionally uses one shared transform . In a trained model, each architecture may learn different weights. Here the witness isolates the neighbor operator: fixed normalization, sampled aggregation, or learned attention.
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Use the Neighbor Operator Comparison Lab to predict which operator gives node 5 the most influence on focus node 3.
Before reveal, the coefficients, sampled-neighbor mask, attention weights, and mixed output vectors stay locked. After you commit, the ledger shows exactly how much influence node 5 received under each operator.
This is a comparison of one layer on one tiny graph. It teaches the operator difference, not a universal ranking of GCN, GraphSAGE, and GAT.
Live Concept Demo
Explore GCN, GraphSAGE, and GAT
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Commit to what GCN, GraphSAGE, and GAT should make visible before reading the result.
After The First Pass
Turn the concept into an inspected object.
Once the invariant is visible in the intuition, math, code, and demo, use these panels to inspect the mechanism visually, check source support, practice the idea, and attach a grounded research question.
Mechanism Storyboard
See the idea move before the page explains it
GCN, GraphSAGE, and GAT differ by the neighbor operator: fixed normalized smoothing, sampled aggregation, or learned attention over a node's neighborhood.
Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change GCN, GraphSAGE, and GAT should make visible.
Visual Inquiry
Make the image answer a mathematical question
GCN, GraphSAGE, and GAT differ by the neighbor operator: fixed normalized smoothing, sampled aggregation, or learned attention over a node's neighborhood.
Which visible object should carry the first intuition?
Pick the cue that should make GCN, GraphSAGE, and GAT easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
Primary source for the GCN layer and the renormalized self-loop adjacency form.
Open sourcePrimary source for GraphSAGE's sample-and-aggregate inductive framing.
Open sourcePrimary source for learned masked self-attention over node neighborhoods.
Open sourceCourse source for comparing GCN, GraphSAGE, and GAT families.
Open sourceImplementation reference for GCNConv, SAGEConv, and GATConv layer APIs.
Open sourceClaim Review
GCN, GraphSAGE, and GAT differ by the neighbor operator: fixed normalized smoothing, sampled aggregation, or learned attention over a node's neighborhood.
Claims without a substantive review badge still need exact source-support review.
kipf-welling-2017-gcn, hamilton-2017-graphsage, velickovic-2018-gat, cs224w-gnn2, pyg-gcn-sage-gat-2026
Use equations, runnable code, and demos to check whether the source support is operational.
The sources support the page's comparison of fixed normalized adjacency mixing, sampled neighborhood aggregation, and learned attention-weighted neighborhood mixing.
Sources: Semi-Supervised Classification with Graph Convolutional Networks, Inductive Representation Learning on Large Graphs, Graph Attention Networks, Stanford CS224W: Graph Neural Networks 2, PyTorch Geometric convolution layer documentationFinite one-node teaching witness only; it does not train the models, compare accuracy, cover edge features, multi-head aggregation, layer stacking, over-smoothing, sampling variance at scale, sparse batching, or graph-transformer variants.A bounded review summary is present; still check caveats and exact reference scope.Checked Kipf/Welling for the normalized self-loop graph convolution, Hamilton/Ying/Leskovec for sample-and-aggregate inductive GraphSAGE, Velickovic et al. for masked attention over neighbors, Stanford CS224W for the course-level comparison, and PyTorch Geometric docs for implementation-level layer forms. GPT Pro publication critique remains pending because 127.0.0.1:51672 is unavailable.
Reviewer: codex-local-source-review; reviewed 2026-07-02Source support candidates
paper 2017Semi-Supervised Classification with Graph Convolutional NetworksPrimary source for the GCN layer and the renormalized self-loop adjacency form.
paper 2017Inductive Representation Learning on Large GraphsPrimary source for GraphSAGE's sample-and-aggregate inductive framing.
paper 2018Graph Attention NetworksPrimary source for learned masked self-attention over node neighborhoods.
course-notes 2026Stanford CS224W: Graph Neural Networks 2Course source for comparing GCN, GraphSAGE, and GAT families.
Practice Loop
Try the idea before it explains itself
GCN, GraphSAGE, and GAT differ by the neighbor operator: fixed normalized smoothing, sampled aggregation, or learned attention over a node's neighborhood.
Before touching the demo, predict one visible change that should happen in GCN, GraphSAGE, and GAT.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
A concrete answer is on the canvas.
The answer names why the claim should hold.
It touches the page context or a neighboring idea.
Research Room
Attach the question to a claim, equation, code, or demo
Pick the concept, equation, source, runnable code, claim, misconception, or demo state before asking for help. The handoff keeps that page item in context.Open the draft below to save one note and next action in this browser.
GCN, GraphSAGE, and GAT
What is the smallest example that makes GCN, GraphSAGE, and GAT click without losing the math?
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays in this browser, attached to the selected learning item.
- References to inspect: attached references on this page.
- Definition, prerequisite, and contrast concept links
- The equation or runnable code that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - GCN, GraphSAGE, and GAT Selected item key: recorded for copy. Context: Machine Learning Page anchor: recorded for copy. Open question: What is the smallest example that makes GCN, GraphSAGE, and GAT click without losing the math? Evidence to inspect: - References to inspect: attached references on this page. - Definition, prerequisite, and contrast concept links - The equation or runnable code that makes the concept operational - One demo state that shows the invariant instead of a slogan What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action.
concept/concept-notebook/machine-learning/gcn-graphsage-gat
concept:machine-learning/gcn-graphsage-gat