Add interactive study note on graph neural networks - #46
Merged
Conversation
Builds message passing from the permutation-equivariance constraint, derives the GCN layer, shows where sum/mean/max differ on neighbourhood multisets, demonstrates over-smoothing, and trains a 2-layer GCN in the browser on a semi-supervised node-classification task. Six demos, all vanilla JS and token-themed with the documented MutationObserver redraw: - relabelling the running citation graph, so the adjacency permutes to PAP^T while the equivariant layer's per-node output does not (and a dense readout on vec(A) does) - stepping message passing one layer at a time, with the selected node's k-hop receptive field - the coefficient matrix under no / row / symmetric normalisation - sum/mean/max on editable neighbourhood multisets, plus the 1-WL blind spot - an over-smoothing slider driving Â^k X out to k = 40 - a GCN trained live with Adam, weight decay and hand-written gradients on a seeded 50-node stochastic block model, with an Â-vs-I toggle Every random quantity is drawn from a seeded PRNG, so the numbers quoted in the prose are reproducible: the demo settles at 0.90 held-out accuracy with  and 0.62 with I at four labels per class. Formulas and claims checked against Kipf & Welling (ICLR 2017), Gilmer et al. (ICML 2017), Xu et al. (ICLR 2019), Morris et al. (AAAI 2019), Li, Han & Wu (AAAI 2018), Oono & Suzuki (ICLR 2020), Hamilton et al. (NeurIPS 2017) and Veličković et al. (ICLR 2018). Also adds a node-link sketch to the posts index so the card gets its own thumbnail rather than the generic fallback. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017myVPR2NyjakpGjN7pLYcj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
docs/_posts/2026-08-09-graph-neural-networks.html, serving at/graph-neural-networks/, plus a thumbnail sketch indocs/posts.html. It's the natural follow-on from the two transformer notes: attention is message passing on a complete graph, and GATs are the bridge.The gap it fills: GNNs usually get introduced either as an opaque
H' = σ(ÂHW)or as a library call, leaving the two things that actually matter implicit — why the layer must be permutation-equivariant, and what the aggregator choice costs in expressive power.Contents
Eight
se-sections, six demos, all vanilla JS with zero dependencies and the documentedMutationObservertoken redraw:PAPᵀwhile the equivariant layer's per-node output stays put, and a dense readout onvec(A)movesÂ^k X, graph coloured by a 1-D projection alongside the mean-pairwise-distance decayThen a per-model table (GCN / GraphSAGE / GAT / GIN, with GAT linking to
/self-attention/), node-vs-edge-vs-graph-level readouts, and takeaways.Accuracy
Every random quantity comes from a seeded PRNG, so the numbers in the prose are reproducible rather than remembered. Formulas and claims were checked against the primary sources — Kipf & Welling (ICLR 2017), Gilmer et al. (ICML 2017), Xu et al. (ICLR 2019), Morris et al. (AAAI 2019), Li, Han & Wu (AAAI 2018), Oono & Suzuki (ICLR 2020), Hamilton et al. (NeurIPS 2017), Veličković et al. (ICLR 2018) — and cited in a closing note.
Three deliberate departures from the original plan, each forced by what the demos actually produced:
Verification
Rendered and inspected in a real browser via
.claude/skills/add-study-note/driver.mjs, in both themes:--sn-*tokens, and all five JS-drawn views registered for the theme redraw./study-notes/with its own thumbnail and excerpt, not the generic fallback.One caveat: the full-page screenshots show the training demo at step 0, because
IntersectionObservernever fires during a headless full-page capture. It starts normally when a reader scrolls to it — hence the headless drive above.🤖 Generated with Claude Code
https://claude.ai/code/session_017myVPR2NyjakpGjN7pLYcj
Generated by Claude Code