Posts by Tags

3D

Why Geometry Matters in Graph Neural Networks

7 minute read

Published:

Many real-world graphs are embedded in 3D space, molecules, proteins, point clouds, crystal structures. Standard GNNs ignore coordinates and only use connectivity. Geometric GNNs incorporate spatial positions and must respect physical symmetries.

ADMET

GNNs for Molecules: Drug Discovery and Material Design

7 minute read

Published:

Graph neural networks are transforming computational drug discovery. Molecules are natural graphs, and GNNs learn molecular representations that predict toxicity, solubility, binding affinity, and synthesis feasibility, tasks that previously required expensive laboratory experiments.

APPNP

APPNP: Personalized PageRank Meets Graph Neural Networks

7 minute read

Published:

APPNP decouples feature transformation from propagation. A neural network transforms features first; then Personalized PageRank propagates the result. This enables deep propagation without over-smoothing.

BERT

Barbero

Sheaf Attention Networks: GAT with Matrices Instead of Scalars

9 minute read

Published:

GAT weights a neighbour by a scalar. SheafAN keeps the scalar and adds a learned orthogonal transport matrix alongside it, recovering GAT exactly at d = 1, and turning a model that goes numerically unstable past eight layers into one that runs to sixty-four.

Bodnar

Neural Sheaf Diffusion: Learning Sheaves End-to-End

10 minute read

Published:

Neural Sheaf Diffusion (Bodnar et al., 2022) learns the sheaf restriction maps from data using a neural network, then performs diffusion with the learned Sheaf Laplacian. This gives a principled, topology-grounded GNN that handles heterophily without heuristic fixes.

CGODE

Graph Neural ODEs: Continuous-Time Graph Dynamics

9 minute read

Published:

Neural ODEs replace discrete layer-by-layer computation with continuous dynamics governed by a differential equation. Graph Neural ODEs apply this to graph data, treating node embeddings as a dynamical system evolving in continuous time.

ChebNet

Chebyshev

ComplEx

Knowledge Graph Embeddings vs GNNs

11 minute read

Published:

Knowledge graph completion can be solved with shallow KG embeddings (TransE, DistMult, ComplEx) or with structural GNNs (R-GCN, CompGCN). Each approach has different inductive biases and failure modes. Understanding when to use each is the central design decision for KG tasks.

DCRNN

GNNs for Traffic Forecasting

8 minute read

Published:

Traffic prediction is a canonical spatio-temporal graph task: sensors on roads form a fixed graph, and speed/volume measurements evolve over time. GNNs capture spatial correlations between sensors; RNNs or convolutions capture temporal patterns. Together they achieve state-of-the-art traffic forecasting.

Spatio-Temporal GNNs: Learning on Graphs Through Time

8 minute read

Published:

Spatio-temporal GNNs combine spatial message passing with temporal sequence modelling. They are the dominant approach for traffic forecasting, weather prediction, and any task where measurements at sensor nodes evolve over time on a fixed graph.

Defferrard

DimeNet

Molecular GNNs: Learning on Atoms and Bonds

9 minute read

Published:

Molecules are graphs. Molecular GNNs predict chemical properties from structure. The best models use 3D coordinates and bond angles, not just connectivity.

Dirichlet-energy

The Sheaf Laplacian: Spectral Theory for Sheaves

7 minute read

Published:

The Sheaf Laplacian generalises the graph Laplacian by incorporating per-edge restriction maps. Its spectrum reveals how consistent data is under the sheaf. Sheaf diffusion with this Laplacian generalises GCN to handle heterophilic graphs.

DistMult

Knowledge Graph Embeddings vs GNNs

11 minute read

Published:

Knowledge graph completion can be solved with shallow KG embeddings (TransE, DistMult, ComplEx) or with structural GNNs (R-GCN, CompGCN). Each approach has different inductive biases and failure modes. Understanding when to use each is the central design decision for KG tasks.

E(n)

EGNN: E(n)-Equivariant Graph Neural Networks

9 minute read

Published:

EGNN achieves E(n)-equivariance with a simple update rule: positions updated via weighted sums of relative position vectors, features updated via invariant distances. No spherical harmonics needed.

Equivariance: What It Means and Why It Matters

9 minute read

Published:

Equivariance formalises the idea that a function should ‘commute with symmetry transformations.’ A rotation-equivariant model applied to rotated input gives the rotated output, no extra training needed. This is the foundation for geometric deep learning.

EGNN

EGNN: E(n)-Equivariant Graph Neural Networks

9 minute read

Published:

EGNN achieves E(n)-equivariance with a simple update rule: positions updated via weighted sums of relative position vectors, features updated via invariant distances. No spherical harmonics needed.

FFN

The Transformer Block: Putting It All Together

6 minute read

Published:

A single Transformer block combines attention, residuals, layer norm, and an FFN into one reusable unit. Understanding this block is understanding the Transformer.

FoPE

FoPE: Fourier Position Embedding for Length Generalization

5 minute read

Published:

FoPE rethinks long-context positional encoding from a frequency-domain perspective. Instead of only stretching RoPE heuristically, it explicitly improves attention’s periodic extension so Transformers generalize more gracefully to longer sequences.

Fourier

FoPE: Fourier Position Embedding for Length Generalization

5 minute read

Published:

FoPE rethinks long-context positional encoding from a frequency-domain perspective. Instead of only stretching RoPE heuristically, it explicitly improves attention’s periodic extension so Transformers generalize more gracefully to longer sequences.

Graph Fourier Transform: The Spectral View of Graphs

8 minute read

Published:

The Graph Fourier Transform decomposes a signal on a graph into frequency components using the Laplacian’s eigenvectors. This spectral view is the mathematical foundation behind spectral GNNs like ChebNet and GCN.

Freebase

GNNs for Knowledge Graphs: Reasoning and Completion

8 minute read

Published:

Knowledge graphs encode human knowledge as typed entity-relation triples. GNNs enable structure-aware entity representation, multi-hop reasoning, knowledge base completion, and entity alignment, tasks that shallow embedding methods cannot fully solve.

GAT

MPNN: The General Message Passing Neural Network Framework

6 minute read

Published:

The MPNN framework (Gilmer et al., 2017) unifies GCN, GAT, GIN, GraphSAGE, and almost all spatial GNNs under one abstraction: message functions, aggregation, and update. Understanding MPNN means understanding the whole GNN family.

GCN

MPNN: The General Message Passing Neural Network Framework

6 minute read

Published:

The MPNN framework (Gilmer et al., 2017) unifies GCN, GAT, GIN, GraphSAGE, and almost all spatial GNNs under one abstraction: message functions, aggregation, and update. Understanding MPNN means understanding the whole GNN family.

GCNII

Depth in GNNs: Why Deeper Is Not Always Better

8 minute read

Published:

In Transformers, depth = expressiveness. In GNNs, depth = both expressiveness AND over-smoothing. The optimal GNN depth is rarely more than 3-4 layers, fundamentally different from the hundreds of layers in modern LLMs.

GIN

Graph Classification: From Node Embeddings to Graph Embeddings

7 minute read

Published:

Graph classification is the task of predicting a label for an entire graph. It requires composing message passing (node embeddings), readout (graph embedding), and a classifier, and all three choices interact to determine model expressiveness.

The Weisfeiler-Lehman Test: How Powerful Are GNNs?

11 minute read

Published:

The 1-WL graph isomorphism test provides the exact upper bound on message-passing GNN expressivity. GIN achieves this bound. Any pair of graphs that 1-WL cannot distinguish cannot be distinguished by any MPNN.

MPNN: The General Message Passing Neural Network Framework

6 minute read

Published:

The MPNN framework (Gilmer et al., 2017) unifies GCN, GAT, GIN, GraphSAGE, and almost all spatial GNNs under one abstraction: message functions, aggregation, and update. Understanding MPNN means understanding the whole GNN family.

GNN

Why GNNs Need Positional Encodings

7 minute read

Published:

Message-passing GNNs are permutation-equivariant by design, they cannot assign unique positions to nodes. Without positional encodings, symmetric nodes are indistinguishable. Here is why that matters and how to fix it.

Depth in GNNs: Why Deeper Is Not Always Better

8 minute read

Published:

In Transformers, depth = expressiveness. In GNNs, depth = both expressiveness AND over-smoothing. The optimal GNN depth is rarely more than 3-4 layers, fundamentally different from the hundreds of layers in modern LLMs.

Over-smoothing vs Over-squashing: The Difference

8 minute read

Published:

Oversmoothing and oversquashing are both problems with deep GNNs, but they affect different nodes, have different causes, and require different fixes. Confusing them leads to applying the wrong solution.

Oversmoothing: When All Node Embeddings Become the Same

9 minute read

Published:

Stack enough GNN layers and all node embeddings converge to the same vector, making the model useless. Oversmoothing is not a training problem; it is a mathematical inevitability of iterated averaging.

GNN-limits

GPT

Graphormer

Shortest-Path Encodings for Graph Transformers

6 minute read

Published:

Shortest-path distances between nodes can be encoded as attention biases or node features, directly informing the model about graph proximity without requiring message passing.

Graphormer: Transformers with Structural Biases for Graphs

9 minute read

Published:

Graphormer encodes graph structure directly into Transformer attention via three biases: node centrality, spatial encoding (shortest paths), and edge encoding. It won the OGB-LSC 2021 competition on molecular property prediction.

H2GCN

Sheaf Neural Networks and Heterophily

9 minute read

Published:

Sheaf GNNs are the principled solution to heterophily: by learning per-edge maps that transform features before comparison, they can perform diffusion that converges within classes and diverges across classes, the exact opposite of standard GCN’s collapse.

HAN

HAN: Heterogeneous Graph Attention Networks

6 minute read

Published:

HAN combines meta-path decomposition with two levels of attention: node-level attention weights neighbours along a meta-path, and semantic-level attention weights different meta-paths. This lets the model learn which relationships matter most for a given task.

Heterogeneous Graphs: When Nodes and Edges Have Types

5 minute read

Published:

Most real-world graphs are heterogeneous, they contain multiple node types (users, items, tags) and edge types (clicks, rates, authors). Standard GNNs treat all nodes and edges identically, making them blind to this type structure.

HOMO-LUMO

Molecular GNNs: Learning on Atoms and Bonds

9 minute read

Published:

Molecules are graphs. Molecular GNNs predict chemical properties from structure. The best models use 3D coordinates and bond angles, not just connectivity.

Jacobian

LLaMA

YaRN: Yet Another RoPE Extensionn Method

6 minute read

Published:

YaRN combines NTK scaling for high-frequency dimensions with linear interpolation for low-frequency ones, plus a temperature correction, achieving better long-context performance with minimal fine-tuning.

LSTM

Set2Set and Attention Readout: Order-Invariant Graph Summaries

8 minute read

Published:

Mean and sum readout treat all nodes equally. Attention readout learns which nodes matter most for a given task. Set2Set goes further, it uses an LSTM to iteratively query the node set, producing richer graph representations than single-pass pooling.

LapPE

Sign Ambiguity in Laplacian Eigenvectors

9 minute read

Published:

Laplacian eigenvectors are only defined up to sign: if u is an eigenvector, so is -u. This seemingly minor issue creates a fundamental problem for learning with LapPE. Here is the problem, its consequences, and how SignNet solves it.

Laplacian Eigenvectors as Graph Positional Encodings

11 minute read

Published:

The k smallest eigenvectors of the graph Laplacian form a natural positional embedding space, the graph’s own coordinate system. They capture global structure, symmetry, and community membership.

Laplacian

Laplacian Eigenvectors as Graph Positional Encodings

11 minute read

Published:

The k smallest eigenvectors of the graph Laplacian form a natural positional embedding space, the graph’s own coordinate system. They capture global structure, symmetry, and community membership.

Oversmoothing: When All Node Embeddings Become the Same

9 minute read

Published:

Stack enough GNN layers and all node embeddings converge to the same vector, making the model useless. Oversmoothing is not a training problem; it is a mathematical inevitability of iterated averaging.

Graph Fourier Transform: The Spectral View of Graphs

8 minute read

Published:

The Graph Fourier Transform decomposes a signal on a graph into frequency components using the Laplacian’s eigenvectors. This spectral view is the mathematical foundation behind spectral GNNs like ChebNet and GCN.

LightGCN

GNNs for Recommender Systems

6 minute read

Published:

Recommendation is naturally a graph problem: users and items are nodes, interactions are edges. GNNs on bipartite user-item graphs capture higher-order collaborative filtering signals, friends of friends liked this, that matrix factorisation cannot represent.

LongRoPE

LongRoPE: Extending Context to 2 Million Tokens

7 minute read

Published:

LongRoPE (Microsoft, 2024) pushes RoPE-based context to 2M tokens by searching for optimal per-dimension rescaling factors, far outperforming NTK or YaRN at extreme lengths.

MACE

Tensor Field Networks and Geometric Deep Learning

8 minute read

Published:

Tensor Field Networks (TFN) were the first architecture to achieve SE(3) equivariance using spherical harmonics and Clebsch-Gordan tensor products. They laid the theoretical foundation for NequIP and MACE, the current state-of-the-art in equivariant molecular force fields.

MLP

MPNN

MPNN: The General Message Passing Neural Network Framework

6 minute read

Published:

The MPNN framework (Gilmer et al., 2017) unifies GCN, GAT, GIN, GraphSAGE, and almost all spatial GNNs under one abstraction: message functions, aggregation, and update. Understanding MPNN means understanding the whole GNN family.

Microsoft

LongRoPE: Extending Context to 2 Million Tokens

7 minute read

Published:

LongRoPE (Microsoft, 2024) pushes RoPE-based context to 2M tokens by searching for optimal per-dimension rescaling factors, far outperforming NTK or YaRN at extreme lengths.

NSD

Neural Sheaf Diffusion: Learning Sheaves End-to-End

10 minute read

Published:

Neural Sheaf Diffusion (Bodnar et al., 2022) learns the sheaf restriction maps from data using a neural network, then performs diffusion with the learned Sheaf Laplacian. This gives a principled, topology-grounded GNN that handles heterophily without heuristic fixes.

NTK

NequIP

Tensor Field Networks and Geometric Deep Learning

8 minute read

Published:

Tensor Field Networks (TFN) were the first architecture to achieve SE(3) equivariance using spherical harmonics and Clebsch-Gordan tensor products. They laid the theoretical foundation for NequIP and MACE, the current state-of-the-art in equivariant molecular force fields.

NeurIPS2022

NeurIPS2022-workshop

Sheaf Attention Networks: GAT with Matrices Instead of Scalars

9 minute read

Published:

GAT weights a neighbour by a scalar. SheafAN keeps the scalar and adds a learned orthogonal transport matrix alongside it, recovering GAT exactly at d = 1, and turning a model that goes numerically unstable past eight layers into one that runs to sixty-four.

OGB

Graphormer: Transformers with Structural Biases for Graphs

9 minute read

Published:

Graphormer encodes graph structure directly into Transformer attention via three biases: node centrality, spatial encoding (shortest paths), and edge encoding. It won the OGB-LSC 2021 competition on molecular property prediction.

PNSD

Polynomial Neural Sheaf Diffusion

8 minute read

Published:

Polynomial Neural Sheaf Diffusion (PNSD) replaces the fixed diffusion operator (I - Δ_F) with a learnable polynomial of the Sheaf Laplacian. This gives the model spectral flexibility, it can learn to amplify or suppress different frequency components of the sheaf signal.

PageRank

APPNP: Personalized PageRank Meets Graph Neural Networks

7 minute read

Published:

APPNP decouples feature transformation from propagation. A neural network transforms features first; then Personalized PageRank propagates the result. This enables deep propagation without over-smoothing.

PinSage

GNNs for Recommender Systems

6 minute read

Published:

Recommendation is naturally a graph problem: users and items are nodes, interactions are edges. GNNs on bipartite user-item graphs capture higher-order collaborative filtering signals, friends of friends liked this, that matrix factorisation cannot represent.

Post-LN

Layer Normalization in Transformers

6 minute read

Published:

Layer norm is not optional plumbing. It determines training stability, gradient flow, and whether deep Transformers converge at all. Pre-LN vs Post-LN is not a detail, it changes training dynamics fundamentally.

Pre-LN

Layer Normalization in Transformers

6 minute read

Published:

Layer norm is not optional plumbing. It determines training stability, gradient flow, and whether deep Transformers converge at all. Pre-LN vs Post-LN is not a detail, it changes training dynamics fundamentally.

QKV

Query, Key, Value: The Intuition Behind QKV

6 minute read

Published:

Q, K, and V are not arbitrary labels. They map precisely onto search queries, database labels, and retrieved content, a framework you already understand.

QM9

Molecular GNNs: Learning on Atoms and Bonds

9 minute read

Published:

Molecules are graphs. Molecular GNNs predict chemical properties from structure. The best models use 3D coordinates and bond angles, not just connectivity.

QSAR

GNNs for Molecules: Drug Discovery and Material Design

7 minute read

Published:

Graph neural networks are transforming computational drug discovery. Molecules are natural graphs, and GNNs learn molecular representations that predict toxicity, solubility, binding affinity, and synthesis feasibility, tasks that previously required expensive laboratory experiments.

R-GCN

Knowledge Graph Embeddings vs GNNs

11 minute read

Published:

Knowledge graph completion can be solved with shallow KG embeddings (TransE, DistMult, ComplEx) or with structural GNNs (R-GCN, CompGCN). Each approach has different inductive biases and failure modes. Understanding when to use each is the central design decision for KG tasks.

R-GCN: Relational Graph Convolutional Networks

7 minute read

Published:

R-GCN extends GCN to multi-relational graphs by learning a separate weight matrix for each relation type. It handles knowledge graphs with typed edges and powers both entity classification and link prediction tasks.

RWPE

Random Walk Positional Encodings

7 minute read

Published:

Random walk positional encodings encode each node’s structural context by computing the probability of returning to it from itself in k steps, a computationally efficient alternative to Laplacian eigenvectors with no sign ambiguity.

RoPE

FoPE: Fourier Position Embedding for Length Generalization

5 minute read

Published:

FoPE rethinks long-context positional encoding from a frequency-domain perspective. Instead of only stretching RoPE heuristically, it explicitly improves attention’s periodic extension so Transformers generalize more gracefully to longer sequences.

Position Interpolation: Extending RoPE with Minimal Fine-Tuning

5 minute read

Published:

Position Interpolation rescales positions before applying RoPE so a model trained on short contexts can be adapted to longer ones with surprisingly little fine-tuning. It became the reference baseline for long-context RoPE extension.

XPos: Length-Extrapolatable Rotary Embeddings

4 minute read

Published:

XPos modifies RoPE with a multiplicative decay that keeps relative rotations while stabilising magnitude at long distance. It is one of the cleanest attempts to make rotary embeddings extrapolate better.

p-RoPE: What Makes Rotary Positional Encodings Useful?

6 minute read

Published:

This paper does two things at once: it explains what RoPE is really doing inside a trained LLM, and it proposes p-RoPE, a partial rotary variant that drops the lowest frequencies to preserve stronger semantic channels.

LongRoPE: Extending Context to 2 Million Tokens

7 minute read

Published:

LongRoPE (Microsoft, 2024) pushes RoPE-based context to 2M tokens by searching for optimal per-dimension rescaling factors, far outperforming NTK or YaRN at extreme lengths.

YaRN: Yet Another RoPE Extensionn Method

6 minute read

Published:

YaRN combines NTK scaling for high-frequency dimensions with linear interpolation for low-frequency ones, plus a temperature correction, achieving better long-context performance with minimal fine-tuning.

SE3-transformer

SE(3)-Transformers: Attention with 3D Symmetry

9 minute read

Published:

SE(3)-Transformers extend self-attention to 3D point clouds and molecular graphs while maintaining SE(3) equivariance. Attention weights are learned between node pairs; values are equivariant features built from spherical harmonics.

SGC

SGC: Simple Graph Convolution

7 minute read

Published:

SGC removes all nonlinearities between GCN layers and collapses the entire propagation into a single pre-computed matrix power. Surprisingly, it matches GCN on most benchmarks, revealing that nonlinearities between layers may be unnecessary.

SO(n)

Bayesian Sheaf Neural Networks: Putting a Distribution on the Geometry

13 minute read

Published:

If a sheaf neural network learns its geometry from data, it can learn the wrong geometry and have no way of knowing. Treating the sheaf Laplacian as a latent random variable fixes that, but requires a reparameterisable distribution on SO(n) with a tractable density, which did not exist.

SO3

Tensor Field Networks and Geometric Deep Learning

8 minute read

Published:

Tensor Field Networks (TFN) were the first architecture to achieve SE(3) equivariance using spherical harmonics and Clebsch-Gordan tensor products. They laid the theoretical foundation for NequIP and MACE, the current state-of-the-art in equivariant molecular force fields.

SPD

Shortest-Path Encodings for Graph Transformers

6 minute read

Published:

Shortest-path distances between nodes can be encoded as attention biases or node features, directly informing the model about graph proximity without requiring message passing.

STGCN

GNNs for Traffic Forecasting

8 minute read

Published:

Traffic prediction is a canonical spatio-temporal graph task: sensors on roads form a fixed graph, and speed/volume measurements evolve over time. GNNs capture spatial correlations between sensors; RNNs or convolutions capture temporal patterns. Together they achieve state-of-the-art traffic forecasting.

Spatio-Temporal GNNs: Learning on Graphs Through Time

8 minute read

Published:

Spatio-temporal GNNs combine spatial message passing with temporal sequence modelling. They are the dominant approach for traffic forecasting, weather prediction, and any task where measurements at sensor nodes evolve over time on a fixed graph.

SchNet

Molecular GNNs: Learning on Atoms and Bonds

9 minute read

Published:

Molecules are graphs. Molecular GNNs predict chemical properties from structure. The best models use 3D coordinates and bond angles, not just connectivity.

SheafAN

Sheaf Attention Networks: GAT with Matrices Instead of Scalars

9 minute read

Published:

GAT weights a neighbour by a scalar. SheafAN keeps the scalar and adds a learned orthogonal transport matrix alongside it, recovering GAT exactly at d = 1, and turning a model that goes numerically unstable past eight layers into one that runs to sixty-four.

SignNet

Sign Ambiguity in Laplacian Eigenvectors

9 minute read

Published:

Laplacian eigenvectors are only defined up to sign: if u is an eigenvector, so is -u. This seemingly minor issue creates a fundamental problem for learning with LapPE. Here is the problem, its consequences, and how SignNet solves it.

SwiGLU

T5

TDA

TFN

Tensor Field Networks and Geometric Deep Learning

8 minute read

Published:

Tensor Field Networks (TFN) were the first architecture to achieve SE(3) equivariance using spherical harmonics and Clebsch-Gordan tensor products. They laid the theoretical foundation for NequIP and MACE, the current state-of-the-art in equivariant molecular force fields.

TGN

Temporal Graph Networks: Learning from Events

8 minute read

Published:

TGN (Temporal Graph Network) is the leading framework for continuous-time dynamic graphs. It maintains a per-node memory that is updated upon each interaction, enabling efficient inductive link prediction on event streams.

TKG

Temporal Knowledge Graphs: Facts That Change Over Time

7 minute read

Published:

Most knowledge graphs treat facts as timeless, but facts change. Barack Obama was president from 2009 to 2017. Temporal Knowledge Graphs add timestamps to triples, requiring models to reason about what was true when.

TransE

Knowledge Graph Embeddings vs GNNs

11 minute read

Published:

Knowledge graph completion can be solved with shallow KG embeddings (TransE, DistMult, ComplEx) or with structural GNNs (R-GCN, CompGCN). Each approach has different inductive biases and failure modes. Understanding when to use each is the central design decision for KG tasks.

WL-test

The Weisfeiler-Lehman Test: How Powerful Are GNNs?

11 minute read

Published:

The 1-WL graph isomorphism test provides the exact upper bound on message-passing GNN expressivity. GIN achieves this bound. Any pair of graphs that 1-WL cannot distinguish cannot be distinguished by any MPNN.

Wikidata

GNNs for Knowledge Graphs: Reasoning and Completion

8 minute read

Published:

Knowledge graphs encode human knowledge as typed entity-relation triples. GNNs enable structure-aware entity representation, multi-hop reasoning, knowledge base completion, and entity alignment, tasks that shallow embedding methods cannot fully solve.

XPos

XPos: Length-Extrapolatable Rotary Embeddings

4 minute read

Published:

XPos modifies RoPE with a multiplicative decay that keeps relative rotations while stabilising magnitude at long distance. It is one of the cleanest attempts to make rotary embeddings extrapolate better.

Xu

The Weisfeiler-Lehman Test: How Powerful Are GNNs?

11 minute read

Published:

The 1-WL graph isomorphism test provides the exact upper bound on message-passing GNN expressivity. GIN achieves this bound. Any pair of graphs that 1-WL cannot distinguish cannot be distinguished by any MPNN.

YaRN

YaRN: Yet Another RoPE Extensionn Method

6 minute read

Published:

YaRN combines NTK scaling for high-frequency dimensions with linear interpolation for low-frequency ones, plus a temperature correction, achieving better long-context performance with minimal fine-tuning.

activation

activation-functions

Activation Functions in Neural Networks: Why Non-Linearity Matters

7 minute read

Published:

Activation functions are the reason neural networks can model curved decision boundaries instead of collapsing into one giant linear map. This chapter builds the intuition first, then walks through the classical functions that shaped deep learning.

adam

Gradient Descent and Backpropagation: How a Model Learns

27 minute read

Published:

Training is one loop: measure the loss, ask backpropagation which way is downhill, take a small step. This chapter derives exactly how small that step has to be, why the answer is 2/a for a quadratic, and why reverse-mode differentiation gets you every gradient for roughly the price of one forward pass.

adjacency-matrix

The Graph Adjacency Matrix: A Graph in Matrix Form

4 minute read

Published:

Before understanding GNNs, you need to understand how graphs are represented mathematically. The adjacency matrix is the foundation, a simple grid that tells you which nodes are connected.

aggregation

Global Pooling in GNNs: Mean, Sum, and Max

6 minute read

Published:

To predict a property of an entire graph, node embeddings must be aggregated into a single vector. The choice of global pooling, mean, sum, or max, is not arbitrary: each has distinct expressive power and fits different tasks.

algorithms

alibi

ALiBi: Attention with Linear Biases

4 minute read

Published:

ALiBi skips traditional positional embeddings entirely and just subtracts a distance penalty from attention scores. Zero extra parameters, excellent extrapolation. Press et al., 2022.

amortised

architecture

The Transformer Block: Putting It All Together

6 minute read

Published:

A single Transformer block combines attention, residuals, layer norm, and an FFN into one reusable unit. Understanding this block is understanding the Transformer.

Transformers: The Architecture That Changed AI

7 minute read

Published:

A self-contained guide to the Transformer, the engine behind GPT, BERT, and modern AI. Learn how attention replaces recurrence and why every major AI system uses it.

arrays

assertions

Errors and Exceptions: EAFP, the Hierarchy, and Reading a Traceback

7 minute read

Published:

Exceptions in Python are not exceptional. They are a normal control-flow mechanism that the language leans on so heavily that the idiomatic style is to try the operation and handle the failure, rather than check first, which is faster, shorter, and free of race conditions.

attention

The Hardware Lottery: Why the Dense Version Won

6 minute read

Published:

Message passing on a sparse graph does asymptotically less work than attention over every pair. It is still the slower one to train. This chapter is about why the architecture that wins is the one your hardware happens to like.

Transformers Are GNNs on Fully Connected Graphs

6 minute read

Published:

Write self-attention in the message-passing template and you get the Graph Attention Network equations with one substitution: the neighbourhood becomes the whole input. The two architectures are not analogous, they are the same operator on different graphs.

GAPE: Remember to Forget, Gated Adaptive Positional Encoding

9 minute read

Published:

GAPE is a drop-in RoPE augmentation that adds content-aware attention logit biases: a query-gate suppresses irrelevant distant context while a key-gate preserves salient distant tokens. Provably sharper attention and improved long-context robustness, no architecture changes needed.

The Transformer Block: Putting It All Together

6 minute read

Published:

A single Transformer block combines attention, residuals, layer norm, and an FFN into one reusable unit. Understanding this block is understanding the Transformer.

Query, Key, Value: The Intuition Behind QKV

6 minute read

Published:

Q, K, and V are not arbitrary labels. They map precisely onto search queries, database labels, and retrieved content, a framework you already understand.

Multi-Head Attention: Many Eyes on the Data

4 minute read

Published:

One attention head sees one relationship. Multiple heads running in parallel let the model capture syntax, semantics, and coreference simultaneously, here’s how.

Self-Attention: Teaching Machines to Focus

5 minute read

Published:

Self-attention is the core of every Transformer. Learn how Query, Key, and Value vectors let every token directly attend to every other, and why that matters.

Sheaf Attention Networks: GAT with Matrices Instead of Scalars

9 minute read

Published:

GAT weights a neighbour by a scalar. SheafAN keeps the scalar and adds a learned orthogonal transport matrix alongside it, recovering GAT exactly at d = 1, and turning a model that goes numerically unstable past eight layers into one that runs to sixty-four.

SE(3)-Transformers: Attention with 3D Symmetry

9 minute read

Published:

SE(3)-Transformers extend self-attention to 3D point clouds and molecular graphs while maintaining SE(3) equivariance. Attention weights are learned between node pairs; values are equivariant features built from spherical harmonics.

HAN: Heterogeneous Graph Attention Networks

6 minute read

Published:

HAN combines meta-path decomposition with two levels of attention: node-level attention weights neighbours along a meta-path, and semantic-level attention weights different meta-paths. This lets the model learn which relationships matter most for a given task.

Graph Transformers: Bringing Attention to Graphs

6 minute read

Published:

Graph Transformers replace or augment local message passing with full pairwise attention, every node attends to every other node. This solves long-range dependencies and over-squashing at the cost of O(N²) computation.

GAT: Graph Attention Networks

5 minute read

Published:

GCN assigns the same (degree-based) weight to every neighbour. GAT learns which neighbours actually matter, using attention coefficients on edges. More expressive, more interpretable.

attention-bias

ALiBi: Attention with Linear Biases

4 minute read

Published:

ALiBi skips traditional positional embeddings entirely and just subtracts a distance penalty from attention scores. Zero extra parameters, excellent extrapolation. Press et al., 2022.

attention-readout

Set2Set and Attention Readout: Order-Invariant Graph Summaries

8 minute read

Published:

Mean and sum readout treat all nodes equally. Attention readout learns which nodes matter most for a given task. Set2Set goes further, it uses an LSTM to iteratively query the node set, producing richer graph representations than single-pass pooling.

autodiff

The Derivative Is a Linear Approximation, and the Gradient Is a Covector

6 minute read

Published:

Treating the derivative as a slope stops working the moment there is more than one input. Treating it as the best linear approximation keeps working forever, and makes backpropagation an obvious consequence of the chain rule rather than an algorithm to memorise.

autoencoder

Latent Diffusion: Denoise Where the Information Is

6 minute read

Published:

Most of the bits in a photograph encode texture no one can see. Latent diffusion throws them away first with an autoencoder, then runs the entire diffusion process in a space roughly forty-eight times smaller, which is how Stable Diffusion fits on a consumer GPU.

axioms

backpropagation

The Derivative Is a Linear Approximation, and the Gradient Is a Covector

6 minute read

Published:

Treating the derivative as a slope stops working the moment there is more than one input. Treating it as the best linear approximation keeps working forever, and makes backpropagation an obvious consequence of the chain rule rather than an algorithm to memorise.

Gradient Descent and Backpropagation: How a Model Learns

27 minute read

Published:

Training is one loop: measure the loss, ask backpropagation which way is downhill, take a small step. This chapter derives exactly how small that step has to be, why the answer is 2/a for a quadratic, and why reverse-mode differentiation gets you every gradient for roughly the price of one forward pass.

bagging

Trees, Forests, and Boosting: Axis-Aligned Everything

15 minute read

Published:

A decision tree chops feature space into axis-aligned boxes and predicts one number per box, which explains why it needs no feature scaling, why it approximates a diagonal boundary as a staircase, and why it cannot extrapolate a single step beyond the training range.

base-rate

basis

Matrices as Linear Maps: Span, Rank, and the Subspaces They Create

7 minute read

Published:

A matrix is not a grid of numbers, it is a map. Once you read it that way, rank, column space, null space and rank–nullity stop being definitions to memorise and become one geometric statement about what the map keeps and what it destroys.

batch-norm

Layer Normalization in Transformers

6 minute read

Published:

Layer norm is not optional plumbing. It determines training stability, gradient flow, and whether deep Transformers converge at all. Pre-LN vs Post-LN is not a detail, it changes training dynamics fundamentally.

bayes

bayesian

Bayesian vs Frequentist: Two Meanings of the Word Probability

6 minute read

Published:

One school says probability is a long-run frequency, so parameters cannot have probabilities. The other says probability is a degree of belief, so they can. Everything else, priors, credible intervals, the whole argument, follows from that one disagreement.

bayesian-deep-learning

Bayesian Sheaf Neural Networks: Putting a Distribution on the Geometry

13 minute read

Published:

If a sheaf neural network learns its geometry from data, it can learn the wrong geometry and have no way of knowing. Treating the sheaf Laplacian as a latent random variable fixes that, but requires a reparameterisable distribution on SO(n) with a tractable density, which did not exist.

beginner

Query, Key, Value: The Intuition Behind QKV

6 minute read

Published:

Q, K, and V are not arbitrary labels. They map precisely onto search queries, database labels, and retrieved content, a framework you already understand.

benchmarks

Graph Classification: From Node Embeddings to Graph Embeddings

7 minute read

Published:

Graph classification is the task of predicting a label for an entire graph. It requires composing message passing (node embeddings), readout (graph embedding), and a classifier, and all three choices interact to determine model expressiveness.

bfs

bias-variance

Estimators, Bias and Variance: Why Unbiased Is Not the Same as Good

6 minute read

Published:

An estimator is a random variable, so it has a mean and a spread. Squared error splits exactly into those two pieces, and once you see the split, it becomes obvious that deliberately biasing an estimator can make it strictly better.

big-o

bipartite-graph

GNNs for Recommender Systems

6 minute read

Published:

Recommendation is naturally a graph problem: users and items are nodes, interactions are edges. GNNs on bipartite user-item graphs capture higher-order collaborative filtering signals, friends of friends liked this, that matrix factorisation cannot represent.

bipartite-graphs

Sheaf4Rec: What a Recommender Gains from a Vector Space per Node

13 minute read

Published:

Collaborative filtering represents every user and item as one static vector. Sheaf4Rec replaces each with a vector space, and reports consistent gains on ranking metrics, though the wins come from recall rather than precision, and the headline efficiency claim is hard to reconcile with the timing table.

blueprint

Geometric Deep Learning: One Blueprint Behind Every Architecture

6 minute read

Published:

CNNs, GNNs, Transformers and sheaf models look like separate inventions. They are the same recipe applied to different domains: identify the symmetry of your data, then build layers that respect it. This book is that recipe, and the arguments that follow from it.

boltzmann

Statistical Mechanics: The Boltzmann Distribution and the Cost of Z

6 minute read

Published:

Counting microstates gives you the Boltzmann distribution, and the Boltzmann distribution gives you softmax, simulated annealing and energy-based models. The partition function is not a bookkeeping constant, it is the object that contains every thermodynamic quantity, and it is intractable for exactly that reason.

bootstrap

The Bootstrap: Uncertainty When the Algebra Runs Out

6 minute read

Published:

If you cannot resample from the population, resample from your sample instead. That one substitution gives standard errors and intervals for statistics whose sampling distributions nobody can write down, and it fails in ways worth memorising.

bottleneck

bpr-loss

Sheaf4Rec: What a Recommender Gains from a Vector Space per Node

13 minute read

Published:

Collaborative filtering represents every user and item as one static vector. Sheaf4Rec replaces each with a vector space, and reports consistent gains on ranking metrics, though the wins come from recall rather than precision, and the headline efficiency claim is hard to reconcile with the timing table.

brownian-motion

bst

calculus

What Mathematics an ML Engineer Actually Needs

5 minute read

Published:

Almost every mathematical question asked in an ML interview reduces to two things: what a matrix does to space, and how to differentiate a composition. This book covers those two things properly and is honest about what you can safely forget.

causal

cayley-transform

Bayesian Sheaf Neural Networks: Putting a Distribution on the Geometry

13 minute read

Published:

If a sheaf neural network learns its geometry from data, it can learn the wrong geometry and have no way of knowing. Treating the sheaf Laplacian as a latent random variable fixes that, but requires a reparameterisable distribution on SO(n) with a tractable density, which did not exist.

cdf

Random Variables: A Density Is Not a Probability

5 minute read

Published:

A probability density can be 2, or 200, and nothing is wrong. Getting clear on what a PDF actually is fixes half the confusion about continuous distributions, and explains the Jacobian term that makes normalising flows work.

cell-complexes

Beyond Simplices: Cell and Combinatorial Complexes

20 minute read

Published:

A simplicial complex cannot hold a benzene ring as a single cell, filling the hexagon costs three edges between atoms that share no bond, and this one constraint is what cell and combinatorial complexes exist to remove.

cellular-sheaf

Sheaf Neural Networks: A Complete Research Guide

9 minute read

Published:

Standard GNNs assume neighbouring nodes should agree. Sheaf Neural Networks replace that assumption with a learned linear map on every edge, which turns heterophily, oversmoothing, and directional structure into one operator: the sheaf Laplacian.

What Is a Sheaf? From Topology to Graph Learning

8 minute read

Published:

A sheaf is a mathematical object from algebraic topology that assigns vector spaces to cells and linear maps between them. On graphs, sheaves assign feature spaces to nodes and edges, with restriction maps encoding how node features relate across edges.

Why Message Passing Is Not Enough: The Case for Sheaves

7 minute read

Published:

Standard message passing aggregates neighbour features and averages. On heterophilic graphs (where neighbours often disagree), this is harmful. Cellular sheaves provide a mathematically principled framework to model per-edge relationships between node features, going beyond mere averaging.

chain-rule

The Derivative Is a Linear Approximation, and the Gradient Is a Covector

6 minute read

Published:

Treating the derivative as a slope stops working the moment there is more than one input. Treating it as the best linear approximation keeps working forever, and makes backpropagation an obvious consequence of the chain rule rather than an algorithm to memorise.

change-of-variables

Random Variables: A Density Is Not a Probability

5 minute read

Published:

A probability density can be 2, or 200, and nothing is wrong. Getting clear on what a PDF actually is fixes half the confusion about continuous distributions, and explains the Jacobian term that makes normalising flows work.

cheeger-inequality

classes

Classes and Objects: self, Attributes, and When Inheritance Is the Wrong Tool

6 minute read

Published:

A Python class is a factory for namespaces, not a sealed blueprint. Once you see where an attribute actually lives, on the instance or on the class, the mutable-default trap, the point of self, and the reason composition usually beats inheritance all fall out of the same rule.

classification

Support Vector Machines: Margins and the Kernel Trick

8 minute read

Published:

Among all the hyperplanes that separate two classes, one sits furthest from both. Finding it turns out to depend on the data only through inner products, and that single fact is what lets you work in a space you never build.

Logistic Regression: Linear in the Log-Odds

19 minute read

Published:

Logistic regression is not a squashed linear regression, it is a straight line drawn in log-odds space, which is why one coefficient means one multiplication of the odds, and why perfectly separable data drives that coefficient to infinity.

closures

clt

clustering

Clustering: What Each Algorithm Assumes a Cluster Is

29 minute read

Published:

k-means says a cluster is a ball around a centroid, DBSCAN says it is a connected dense region, and a Gaussian mixture says it is a bump in a density, pick the algorithm and you have already picked the answer.

DiffPool: Learning Hierarchical Graph Pooling

8 minute read

Published:

DiffPool learns to hierarchically cluster nodes into super-nodes across layers, like a convolutional pyramid for graphs. Unlike flat global pooling, it captures multi-scale graph structure by differentiably assigning nodes to clusters.

cnn

Grids: Why Translation Equivariance Forces Convolution

5 minute read

Published:

Convolution is not a clever idea someone had about images. It is the only linear map that commutes with translation, a theorem, not a design choice, and one you can verify by exhaustion on a small enough case.

Convolutions and CNNs: Weight Sharing as a Prior

22 minute read

Published:

A dense layer from a 224-by-224 colour image to 1000 units holds 150.5 million weights; a 3-by-3, 64-filter convolution holds 1,792, and the two constraints that buy that factor of 84,000 are exactly the prior that makes it work on images.

coboundary

The Sheaf Laplacian: Spectral Theory for Sheaves

7 minute read

Published:

The Sheaf Laplacian generalises the graph Laplacian by incorporating per-edge restriction maps. Its spectrum reveals how consistent data is under the sheaf. Sheaf diffusion with this Laplacian generalises GCN to handle heterophilic graphs.

collaborative-filtering

Sheaf4Rec: What a Recommender Gains from a Vector Space per Node

13 minute read

Published:

Collaborative filtering represents every user and item as one static vector. Sheaf4Rec replaces each with a vector space, and reports consistent gains on ranking metrics, though the wins come from recall rather than precision, and the headline efficiency claim is hard to reconcile with the timing table.

GNNs for Recommender Systems

6 minute read

Published:

Recommendation is naturally a graph problem: users and items are nodes, interactions are edges. GNNs on bipartite user-item graphs capture higher-order collaborative filtering signals, friends of friends liked this, that matrix factorisation cannot represent.

collections

Dicts and Sets: Hashing, Defaults, and What Makes a Key Legal

7 minute read

Published:

A dict trades memory for the ability to skip the search entirely. Everything that follows, why keys must be hashable, why lists cannot be keys, and why 1, 1.0 and True collide, comes from that single trade.

combinatorial-complexes

Beyond Simplices: Cell and Combinatorial Complexes

20 minute read

Published:

A simplicial complex cannot hold a benzene ring as a single cell, filling the hexagon costs three edges between atoms that share no bond, and this one constraint is what cell and combinatorial complexes exist to remove.

community-detection

GNNs for Social Networks: Influence, Communities, and Misinformation

7 minute read

Published:

Social networks are large sparse graphs with rich node features (user profiles) and heterogeneous edges (friendship, follow, retweet). GNNs predict user behaviour, detect communities, identify influential spreaders, and flag misinformation, tasks with significant real-world impact.

comparison

Over-smoothing vs Over-squashing: The Difference

8 minute read

Published:

Oversmoothing and oversquashing are both problems with deep GNNs, but they affect different nodes, have different causes, and require different fixes. Confusing them leads to applying the wrong solution.

complexity

comprehensions

concentration

condition-number

Convexity: What It Guarantees, and Why Deep Learning Works Without It

8 minute read

Published:

Convexity buys one enormous guarantee, every local minimum is global, and it says nothing at all about speed. Deep learning throws the guarantee away and still works, and it is worth being precise about how much of that we actually understand.

conditioning

confidence-intervals

Confidence Intervals: The Interval Is Random, the Parameter Is Not

5 minute read

Published:

A 95% confidence interval does not say the parameter is 95% likely to be inside it. It says the recipe that produced the interval succeeds 95% of the time. That distinction is the single most-failed question in statistics interviews.

conformal-maps

Cooperative Sheaf Neural Networks: Listening Without Speaking

14 minute read

Published:

A sheaf gives every node a matrix-valued say in how its neighbours reach it, but not in whether they do. Set a node’s restriction maps to zero to stop it listening and you also stop it speaking. Fixing that needs sheaves on directed graphs, and the fix costs the Laplacian its positive semi-definiteness.

conjugate-prior

Bayesian vs Frequentist: Two Meanings of the Word Probability

6 minute read

Published:

One school says probability is a long-run frequency, so parameters cannot have probabilities. The other says probability is a degree of belief, so they can. Everything else, priors, credible intervals, the whole argument, follows from that one disagreement.

connection-Laplacian

Equivariant Sheaf Neural Networks

9 minute read

Published:

Sheaves with orthogonal restriction maps define a connection on the graph, a parallel transport structure over edges. This connects sheaf GNNs to differential geometry and enables equivariant processing of data with local coordinate frames at each node.

connection-laplacian

Sheaf-Based Positional Encodings: Letting Node Features Into the Spectrum

12 minute read

Published:

Laplacian eigenvector positional encodings tell a node where it sits in the graph, but the graph Laplacian only knows adjacency, so two structurally identical nodes get identical encodings no matter how different their features are. Swap in the sheaf Laplacian and the features enter the spectrum.

Conn-NSD: Computing the Sheaf Instead of Learning It

11 minute read

Published:

Neural Sheaf Diffusion learns the restriction maps by gradient descent. Conn-NSD computes them once, before training, by assuming the data lies on a manifold and optimally aligning neighbouring tangent spaces, matching the learned models on small graphs at roughly half the cost per epoch.

conservation-laws

Noether’s Theorem: Symmetry, Conservation, and Equivariant Networks

6 minute read

Published:

Energy is conserved because the laws of physics do not care what time it is. That single sentence is Noether’s theorem, and its machine learning descendant is the reason an equivariant network needs less data than one that must learn the symmetry from examples.

consistency-models

Distillation and Consistency Models: Getting to Four Steps

6 minute read

Published:

Better ODE solvers bottom out around ten evaluations because the trajectory is genuinely curved. To go lower you have to change the model, either teach a student to take two teacher steps at once, or train a network that jumps to the end of the trajectory from anywhere on it.

context-length

LongRoPE: Extending Context to 2 Million Tokens

7 minute read

Published:

LongRoPE (Microsoft, 2024) pushes RoPE-based context to 2M tokens by searching for optimal per-dimension rescaling factors, far outperforming NTK or YaRN at extreme lengths.

YaRN: Yet Another RoPE Extensionn Method

6 minute read

Published:

YaRN combines NTK scaling for high-frequency dimensions with linear interpolation for low-frequency ones, plus a temperature correction, achieving better long-context performance with minimal fine-tuning.

context-managers

Files and Context Managers: Why with Is Not Optional

7 minute read

Published:

A file object that falls out of scope without with does get closed eventually, but ‘eventually’ means whenever the garbage collector gets around to it, which is not a promise any program handling more than a handful of files can live with.

continuous-normalising-flows

Flow Matching: Training a Velocity Field Without Ever Solving an ODE

7 minute read

Published:

Continuous normalising flows were elegant and nearly untrainable, every gradient step needed an ODE solve and a divergence estimate. Flow matching removes both by regressing a velocity field against a target you can write down in closed form, one example at a time.

continuous-time

Graph Neural ODEs: Continuous-Time Graph Dynamics

9 minute read

Published:

Neural ODEs replace discrete layer-by-layer computation with continuous dynamics governed by a differential equation. Graph Neural ODEs apply this to graph data, treating node embeddings as a dynamical system evolving in continuous time.

Temporal Graph Networks: Learning from Events

8 minute read

Published:

TGN (Temporal Graph Network) is the leading framework for continuous-time dynamic graphs. It maintains a per-node memory that is updated upon each interaction, enabling efficient inductive link prediction on event streams.

Static vs Dynamic Graphs: When Structure Changes Over Time

6 minute read

Published:

Most GNN research assumes a fixed graph. Real graphs evolve: edges appear and disappear, node features drift, new nodes arrive. Dynamic graph learning addresses how to model and predict on graphs whose structure changes over time.

control-flow

convergence

Oversmoothing: When All Node Embeddings Become the Same

9 minute read

Published:

Stack enough GNN layers and all node embeddings converge to the same vector, making the model useless. Oversmoothing is not a training problem; it is a mathematical inevitability of iterated averaging.

convexity

Convexity: What It Guarantees, and Why Deep Learning Works Without It

8 minute read

Published:

Convexity buys one enormous guarantee, every local minimum is global, and it says nothing at all about speed. Deep learning throws the guarantee away and still works, and it is worth being precise about how much of that we actually understand.

convolution

Grids: Why Translation Equivariance Forces Convolution

5 minute read

Published:

Convolution is not a clever idea someone had about images. It is the only linear map that commutes with translation, a theorem, not a design choice, and one you can verify by exhaustion on a small enough case.

Convolutions and CNNs: Weight Sharing as a Prior

22 minute read

Published:

A dense layer from a 224-by-224 colour image to 1000 units holds 150.5 million weights; a 3-by-3, 64-filter convolution holds 1,792, and the two constraints that buy that factor of 84,000 are exactly the prior that makes it work on images.

GCN: Graph Convolutional Networks

5 minute read

Published:

GCN (Kipf & Welling, 2016) is the ‘hello world’ of GNNs. It simplifies spectral graph convolution into a single elegant layer: normalised neighbourhood averaging with a learned linear transformation.

cooperative-gnns

Cooperative Sheaf Neural Networks: Listening Without Speaking

14 minute read

Published:

A sheaf gives every node a matrix-valued say in how its neighbours reach it, but not in whether they do. Set a node’s restriction maps to zero to stop it listening and you also stop it speaking. Fixing that needs sheaves on directed graphs, and the fix costs the Laplacian its positive semi-definiteness.

coordinates

EGNN: E(n)-Equivariant Graph Neural Networks

9 minute read

Published:

EGNN achieves E(n)-equivariance with a simple update rule: positions updated via weighted sums of relative position vectors, features updated via invariant distances. No spherical harmonics needed.

Why Geometry Matters in Graph Neural Networks

7 minute read

Published:

Many real-world graphs are embedded in 3D space, molecules, proteins, point clouds, crystal structures. Standard GNNs ignore coordinates and only use connectivity. Geometric GNNs incorporate spatial positions and must respect physical symmetries.

correlation

Expectation and Variance: Linearity Is Free, Additivity Is Not

5 minute read

Published:

Expectation adds up no matter how tangled the dependence. Variance does not, and the correction term, covariance, is where most of the interesting behaviour of ensembles, portfolios and minibatch gradients lives.

cosine-schedule

The Forward Process: A Corruption Engineered to Be Jumped Into

6 minute read

Published:

The forward process looks like the trivial half of diffusion, but every term in it is load-bearing. Drop the shrink factor and the variance diverges; pick the wrong schedule and a third of your timesteps are spent denoising static.

cosine-similarity

Norms, Inner Products, and the Geometry Behind L1 Sparsity

7 minute read

Published:

L1 regularisation produces exact zeros and L2 does not. The reason is not statistical, it is geometric: the L1 unit ball has corners on the axes, and corners are what optimisation solutions stick to.

counting

covariance

Expectation and Variance: Linearity Is Free, Additivity Is Not

5 minute read

Published:

Expectation adds up no matter how tangled the dependence. Variance does not, and the correction term, covariance, is where most of the interesting behaviour of ensembles, portfolios and minibatch gradients lives.

cpython

credible-interval

Bayesian vs Frequentist: Two Meanings of the Word Probability

6 minute read

Published:

One school says probability is a long-run frequency, so parameters cannot have probabilities. The other says probability is a degree of belief, so they can. Everything else, priors, credible intervals, the whole argument, follows from that one disagreement.

cross-attention

cross-entropy

Logistic Regression: Linear in the Log-Odds

19 minute read

Published:

Logistic regression is not a squashed linear regression, it is a straight line drawn in log-odds space, which is why one coefficient means one multiplication of the odds, and why perfectly separable data drives that coefficient to infinity.

cross-validation

The Bootstrap: Uncertainty When the Algebra Runs Out

6 minute read

Published:

If you cannot resample from the population, resample from your sample instead. That one substitution gives standard errors and intervals for statistics whose sampling distributions nobody can write down, and it fails in ways worth memorising.

curvature

Curvature: Why a Flat Map of the Earth Must Lie

6 minute read

Published:

Curvature at a point is one over the radius of the circle that best hugs the curve there. Push that idea up to surfaces and Gauss’s Theorema Egregium falls out: some curvature is visible from inside the surface, which is why no map projection can ever get distances right.

Jacobians, Hessians, and Why Newton’s Method Loses at Scale

7 minute read

Published:

The Jacobian tells you how a map distorts volume, which is exactly the term normalising flows have to pay. The Hessian tells you the shape of the valley you are descending. Both are indispensable to reason with and, at a billion parameters, hopeless to form.

cvpr

Z-SASLM: Zero-Shot Style Blending via Spherical Interpolation

9 minute read

Published:

Z-SASLM is a zero-shot, fine-tuning-free style blending pipeline that replaces linear latent interpolation with SLERP along the geodesic of the hypersphere, preserving latent manifold structure when blending multiple styles. Published at CVPR 2025 Workshop.

data-model

Dunder Methods: How Python’s Protocols Replace Interfaces

6 minute read

Published:

Python has almost no interfaces to implement and no operators to declare. Instead, every piece of syntax, len(x), x[i], for y in x, a + b, with r as f, is a documented call to a method with a double-underscore name. Learn the mapping and your own types stop being second-class citizens.

data-structures

dataclasses

Classes and Objects: self, Attributes, and When Inheritance Is the Wrong Tool

6 minute read

Published:

A Python class is a factory for namespaces, not a sealed blueprint. Once you see where an attribute actually lives, on the instance or on the class, the mutable-default trap, the point of self, and the reason composition usually beats inheritance all fall out of the same rule.

dbscan

Clustering: What Each Algorithm Assumes a Cluster Is

29 minute read

Published:

k-means says a cluster is a ball around a centroid, DBSCAN says it is a connected dense region, and a Gaussian mixture says it is a bump in a density, pick the algorithm and you have already picked the answer.

ddim

DDIM: Same Marginals, Fewer Steps, and a Latent Space Worth Having

5 minute read

Published:

DDPM’s objective never actually required the forward process to be Markov, only that its marginals be Gaussian. Dropping the Markov assumption exposes a whole family of samplers a trained model already supports, including a deterministic one that runs in 20 steps and gives an invertible latent space.

ddpm

DDPM Training: From a Variational Bound to Four Lines of PyTorch

5 minute read

Published:

The DDPM objective starts as a variational bound with T+1 KL terms and ends as a plain mean-squared error on noise. Following the collapse shows why the discarded weighting term is not an approximation you tolerate but a reweighting that improves samples.

Diffusion Models: Learning to Undo Noise

4 minute read

Published:

Destroying an image is easy and needs no learning at all. Diffusion models exploit that asymmetry: they define a trivial forward corruption, then train a network to walk it backwards one small step at a time.

decision-trees

Trees, Forests, and Boosting: Axis-Aligned Everything

15 minute read

Published:

A decision tree chops feature space into axis-aligned boxes and predicts one number per box, which explains why it needs no feature scaling, why it approximates a diagonal boundary as a staircase, and why it cannot extrapolate a single step beyond the training range.

decoder

deep-gnns

DNSD: Making Sheaf Diffusion Work at Depth

12 minute read

Published:

Neural Sheaf Diffusion has a theoretical guarantee against representation collapse that does not survive contact with depth. DNSD diagnoses why, the Laplacian’s disagreement signal vanishes as diffusion succeeds, and replaces the operator rather than patching around it.

deep-learning

Transformers: The Architecture That Changed AI

7 minute read

Published:

A self-contained guide to the Transformer, the engine behind GPT, BERT, and modern AI. Learn how attention replaces recurrence and why every major AI system uses it.

Machine Learning Before Transformers: A Working Foundation

4 minute read

Published:

Every later book on this site assumes you already know what a loss is, why gradient descent works, and what a convolution buys you. This book supplies that, and follows one thread through it: how much structure you build in versus how much you let the data decide.

depth

Residual Connections: Why Transformers Can Be Deep

7 minute read

Published:

Without residual connections, training a 96-layer Transformer would be practically impossible. The skip connection is a simple addition that solves the vanishing gradient problem and enables arbitrary depth.

Depth in GNNs: Why Deeper Is Not Always Better

8 minute read

Published:

In Transformers, depth = expressiveness. In GNNs, depth = both expressiveness AND over-smoothing. The optimal GNN depth is rarely more than 3-4 layers, fundamentally different from the hundreds of layers in modern LLMs.

Over-smoothing vs Over-squashing: The Difference

8 minute read

Published:

Oversmoothing and oversquashing are both problems with deep GNNs, but they affect different nodes, have different causes, and require different fixes. Confusing them leads to applying the wrong solution.

Oversmoothing: When All Node Embeddings Become the Same

9 minute read

Published:

Stack enough GNN layers and all node embeddings converge to the same vector, making the model useless. Oversmoothing is not a training problem; it is a mathematical inevitability of iterated averaging.

descriptive-statistics

determinant

Linear Maps as Geometry: Rotate, Scale, Rotate

6 minute read

Published:

A matrix is not a table of numbers, it is a deformation of space. The SVD says every deformation is the same three moves in sequence: rotate, stretch along axes, rotate again.

deterministic-sampling

DDIM: Same Marginals, Fewer Steps, and a Latent Space Worth Having

5 minute read

Published:

DDPM’s objective never actually required the forward process to be Markov, only that its marginals be Gaussian. Dropping the Markov assumption exposes a whole family of samplers a trained model already supports, including a deterministic one that runs in 20 steps and gives an invertible latent space.

dfs

diagonal

Diagonal, Orthogonal, and General Sheaf Maps

8 minute read

Published:

The restriction maps in a cellular sheaf can be constrained to different matrix classes: scalars, diagonal matrices, orthogonal matrices, or general matrices. Each class offers a different trade-off between expressivity and computational cost.

dictionaries

Dicts and Sets: Hashing, Defaults, and What Makes a Key Legal

7 minute read

Published:

A dict trades memory for the ability to skip the search entirely. Everything that follows, why keys must be hashable, why lists cannot be keys, and why 1, 1.0 and True collide, comes from that single trade.

differential-geometry

Curvature: Why a Flat Map of the Earth Must Lie

6 minute read

Published:

Curvature at a point is one over the radius of the circle that best hugs the curve there. Push that idea up to surfaces and Gauss’s Theorema Egregium falls out: some curvature is visible from inside the surface, which is why no map projection can ever get distances right.

diffpool

DiffPool: Learning Hierarchical Graph Pooling

8 minute read

Published:

DiffPool learns to hierarchically cluster nodes into super-nodes across layers, like a convolutional pyramid for graphs. Unlike flat global pooling, it captures multi-scale graph structure by differentiably assigning nodes to clusters.

diffusion

Diffusion vs Flow Matching: Two Names for One Family

5 minute read

Published:

Flow matching is often presented as the successor to diffusion. It is more accurate, and more useful, to say that diffusion is one particular probability path inside the flow-matching framework, and not the straightest one available.

Distillation and Consistency Models: Getting to Four Steps

6 minute read

Published:

Better ODE solvers bottom out around ten evaluations because the trajectory is genuinely curved. To go lower you have to change the model, either teach a student to take two teacher steps at once, or train a network that jumps to the end of the trajectory from anywhere on it.

Latent Diffusion: Denoise Where the Information Is

6 minute read

Published:

Most of the bits in a photograph encode texture no one can see. Latent diffusion throws them away first with an autoencoder, then runs the entire diffusion process in a space roughly forty-eight times smaller, which is how Stable Diffusion fits on a consumer GPU.

DDIM: Same Marginals, Fewer Steps, and a Latent Space Worth Having

5 minute read

Published:

DDPM’s objective never actually required the forward process to be Markov, only that its marginals be Gaussian. Dropping the Markov assumption exposes a whole family of samplers a trained model already supports, including a deterministic one that runs in 20 steps and gives an invertible latent space.

Score Matching and the SDE View: DDPM as One Discretisation Among Many

5 minute read

Published:

Noise prediction and score estimation are the same network in different units. Taking the step size to zero turns the whole method into a stochastic differential equation, and reveals a deterministic ODE with identical marginals hiding inside it.

DDPM Training: From a Variational Bound to Four Lines of PyTorch

5 minute read

Published:

The DDPM objective starts as a variational bound with T+1 KL terms and ends as a plain mean-squared error on noise. Following the collapse shows why the discarded weighting term is not an approximation you tolerate but a reweighting that improves samples.

The Forward Process: A Corruption Engineered to Be Jumped Into

6 minute read

Published:

The forward process looks like the trivial half of diffusion, but every term in it is load-bearing. Drop the shrink factor and the variance diverges; pick the wrong schedule and a third of your timesteps are spent denoising static.

Diffusion Models: Learning to Undo Noise

4 minute read

Published:

Destroying an image is easy and needs no learning at all. Diffusion models exploit that asymmetry: they define a trivial forward corruption, then train a network to walk it backwards one small step at a time.

The Sheaf Laplacian: Spectral Theory for Sheaves

7 minute read

Published:

The Sheaf Laplacian generalises the graph Laplacian by incorporating per-edge restriction maps. Its spectrum reveals how consistent data is under the sheaf. Sheaf diffusion with this Laplacian generalises GCN to handle heterophilic graphs.

diffusion-models

Z-SASLM: Zero-Shot Style Blending via Spherical Interpolation

9 minute read

Published:

Z-SASLM is a zero-shot, fine-tuning-free style blending pipeline that replaces linear latent interpolation with SLERP along the geodesic of the hypersphere, preserving latent manifold structure when blending multiple styles. Published at CVPR 2025 Workshop.

dijkstra

dimensionality-reduction

PCA: Maximum Variance and Minimum Reconstruction Error

6 minute read

Published:

PCA can be derived by asking for the directions of greatest spread, or by asking for the subspace that loses the least when you project onto it. The two questions look unrelated and have the same answer, which is the most useful thing to understand about it.

directed

directed-graphs

Cooperative Sheaf Neural Networks: Listening Without Speaking

14 minute read

Published:

A sheaf gives every node a matrix-valued say in how its neighbours reach it, but not in whether they do. Set a node’s restriction maps to zero to stop it listening and you also stop it speaking. Fixing that needs sheaves on directed graphs, and the fix costs the Laplacian its positive semi-definiteness.

dirichlet

dirichlet-energy

Sheaf Hypergraph Networks: Apparent Consensus in Higher-Order Relations

13 minute read

Published:

A graph edge relates two things. A hyperedge relates any number of them, and hypergraph networks aggregate over it uniformly, every member contributes the same way. Attaching a sheaf gives each member its own linear map into the group, and turns forced consensus into apparent consensus.

distance-encoding

Shortest-Path Encodings for Graph Transformers

6 minute read

Published:

Shortest-path distances between nodes can be encoded as attention biases or node features, directly informing the model about graph proximity without requiring message passing.

distillation

Distillation and Consistency Models: Getting to Four Steps

6 minute read

Published:

Better ODE solvers bottom out around ten evaluations because the trajectory is genuinely curved. To go lower you have to change the model, either teach a student to take two teacher steps at once, or train a network that jumps to the end of the trajectory from anywhere on it.

distinction

Structural vs Positional Encodings in Graphs

7 minute read

Published:

Positional encodings say where a node is in the graph. Structural encodings say what role it plays. They are complementary, and confusing them leads to poor design choices.

distributions

dpm-solver

drug-discovery

GNNs for Molecules: Drug Discovery and Material Design

7 minute read

Published:

Graph neural networks are transforming computational drug discovery. Molecules are natural graphs, and GNNs learn molecular representations that predict toxicity, solubility, binding affinity, and synthesis feasibility, tasks that previously required expensive laboratory experiments.

Molecular GNNs: Learning on Atoms and Bonds

9 minute read

Published:

Molecules are graphs. Molecular GNNs predict chemical properties from structure. The best models use 3D coordinates and bond angles, not just connectivity.

dunder

Dunder Methods: How Python’s Protocols Replace Interfaces

6 minute read

Published:

Python has almost no interfaces to implement and no operators to declare. Instead, every piece of syntax, len(x), x[i], for y in x, a + b, with r as f, is a documented call to a method with a double-underscore name. Learn the mapping and your own types stop being second-class citizens.

dynamic-graph

Static vs Dynamic Graphs: When Structure Changes Over Time

6 minute read

Published:

Most GNN research assumes a fixed graph. Real graphs evolve: edges appear and disappear, node features drift, new nodes arrive. Dynamic graph learning addresses how to model and predict on graphs whose structure changes over time.

dynamic-graphs

BrainDyn: Sheaves Meet Neural ODEs for Brain Dynamics

11 minute read

Published:

Brain regions do not encode information in a shared feature space, which is exactly the assumption scalar message passing makes. BrainDyn puts learnable restriction maps between regions and integrates the result as a continuous-time system, the first pairing of cellular sheaves with neural ODEs.

dynamic-programming

Recursion and Dynamic Programming: Two Conditions, One Filled Table

7 minute read

Published:

Dynamic programming is not a trick, it is a diagnosis: if a problem has optimal substructure and overlapping subproblems, exhaustive recursion is doing the same work exponentially often and a table fixes it. Here is the diagnosis, and edit distance worked out cell by cell.

e3nn

Groups: Equivariance Beyond Translation

6 minute read

Published:

Translation is one group. Swap it for rotations, reflections, or the rigid motions of 3-D space and the same construction produces a different architecture, with the parameter count cut by exactly the size of the orbit.

eafp

Errors and Exceptions: EAFP, the Hierarchy, and Reading a Traceback

7 minute read

Published:

Exceptions in Python are not exceptional. They are a normal control-flow mechanism that the language leans on so heavily that the idiomatic style is to try the operation and handle the failure, rather than check first, which is faster, shorter, and free of race conditions.

edges

edit-distance

Recursion and Dynamic Programming: Two Conditions, One Filled Table

7 minute read

Published:

Dynamic programming is not a trick, it is a diagnosis: if a problem has optimal substructure and overlapping subproblems, exhaustive recursion is doing the same work exponentially often and a table fixes it. Here is the diagnosis, and edit distance worked out cell by cell.

eeg

BrainDyn: Sheaves Meet Neural ODEs for Brain Dynamics

11 minute read

Published:

Brain regions do not encode information in a shared feature space, which is exactly the assumption scalar message passing makes. BrainDyn puts learnable restriction maps between regions and integrates the result as a continuous-time system, the first pairing of cellular sheaves with neural ODEs.

effective-resistance

efficiency

SGC: Simple Graph Convolution

7 minute read

Published:

SGC removes all nonlinearities between GCN layers and collapses the entire propagation into a single pre-computed matrix power. Surprisingly, it matches GCN on most benchmarks, revealing that nonlinearities between layers may be unnecessary.

egnn

Equivariant Sheaf Neural Networks: Learning Geometric Transport on Graphs

33 minute read

Published:

Sheaf networks move features through matrix-valued maps but ignore the symmetries of physical space; equivariant GNNs respect those symmetries but move vectors with scalars. ESNN does both, learned, directed, matrix-valued transport that is exactly E(n)-equivariant, and proves that when displacement is the only geometric input, the radial–tangential family is all the linear transport there is.

eigenvalues

Eigenvectors, the Spectral Theorem, and Why the SVD Always Exists

7 minute read

Published:

Eigenvectors are the directions a matrix does not rotate, when they exist. The SVD asks a weaker question that always has an answer, and that is exactly why it, not the eigendecomposition, is the workhorse of applied linear algebra.

eigenvectors

PCA: Maximum Variance and Minimum Reconstruction Error

6 minute read

Published:

PCA can be derived by asking for the directions of greatest spread, or by asking for the subspace that loses the least when you project onto it. The two questions look unrelated and have the same answer, which is the most useful thing to understand about it.

Sign Ambiguity in Laplacian Eigenvectors

9 minute read

Published:

Laplacian eigenvectors are only defined up to sign: if u is an eigenvector, so is -u. This seemingly minor issue creates a fundamental problem for learning with LapPE. Here is the problem, its consequences, and how SignNet solves it.

Laplacian Eigenvectors as Graph Positional Encodings

11 minute read

Published:

The k smallest eigenvectors of the graph Laplacian form a natural positional embedding space, the graph’s own coordinate system. They capture global structure, symmetry, and community membership.

Graph Fourier Transform: The Spectral View of Graphs

8 minute read

Published:

The Graph Fourier Transform decomposes a signal on a graph into frequency components using the Laplacian’s eigenvectors. This spectral view is the mathematical foundation behind spectral GNNs like ChebNet and GCN.

elbo

Entropy and Free Energy: From the Second Law to the ELBO

6 minute read

Published:

Thermodynamic entropy and Shannon entropy differ by a constant with units. Once you accept that, the ELBO stops being an inference trick and becomes a free energy, and diffusion models stop being a clever architecture and become a driven non-equilibrium process.

DDPM Training: From a Variational Bound to Four Lines of PyTorch

5 minute read

Published:

The DDPM objective starts as a variational bound with T+1 KL terms and ends as a plain mean-squared error on noise. Following the collapse shows why the discarded weighting term is not an approximation you tolerate but a reweighting that improves samples.

encoder

encoder-decoder

encoding

end-to-end

Graph Classification: From Node Embeddings to Graph Embeddings

7 minute read

Published:

Graph classification is the task of predicting a label for an entire graph. It requires composing message passing (node embeddings), readout (graph embedding), and a classifier, and all three choices interact to determine model expressiveness.

energy-based-models

Statistical Mechanics: The Boltzmann Distribution and the Cost of Z

6 minute read

Published:

Counting microstates gives you the Boltzmann distribution, and the Boltzmann distribution gives you softmax, simulated annealing and energy-based models. The partition function is not a bookkeeping constant, it is the object that contains every thermodynamic quantity, and it is intractable for exactly that reason.

energy-conservation

Surfing on the Neural Sheaf: What Happens If You Use the Wave Equation

9 minute read

Published:

Every sheaf model so far discretises the heat equation, which dissipates energy. Suk et al. try the wave equation instead, which conserves it, a one-line change of PDE with a clean theoretical motivation and a genuinely mixed empirical result.

ensembles

Trees, Forests, and Boosting: Axis-Aligned Everything

15 minute read

Published:

A decision tree chops feature space into axis-aligned boxes and predicts one number per box, which explains why it needs no feature scaling, why it approximates a diagonal boundary as a staircase, and why it cannot extrapolate a single step beyond the training range.

entity-alignment

GNNs for Knowledge Graphs: Reasoning and Completion

8 minute read

Published:

Knowledge graphs encode human knowledge as typed entity-relation triples. GNNs enable structure-aware entity representation, multi-hop reasoning, knowledge base completion, and entity alignment, tasks that shallow embedding methods cannot fully solve.

entity-classification

R-GCN: Relational Graph Convolutional Networks

7 minute read

Published:

R-GCN extends GCN to multi-relational graphs by learning a separate weight matrix for each relation type. It handles knowledge graphs with typed edges and powers both entity classification and link prediction tasks.

entropy

Entropy and Free Energy: From the Second Law to the ELBO

6 minute read

Published:

Thermodynamic entropy and Shannon entropy differ by a constant with units. Once you accept that, the ELBO stops being an inference trick and becomes a free energy, and diffusion models stop being a clever architecture and become a driven non-equilibrium process.

equivariance

Noether’s Theorem: Symmetry, Conservation, and Equivariant Networks

6 minute read

Published:

Energy is conserved because the laws of physics do not care what time it is. That single sentence is Noether’s theorem, and its machine learning descendant is the reason an equivariant network needs less data than one that must learn the symmetry from examples.

Symmetry and Groups: Invariance, Equivariance, and Why You Build It In

6 minute read

Published:

If rotating a molecule cannot change its energy, that is a fact about the target function you know before training starts. Encoding it in the architecture makes it true everywhere; learning it from augmented data makes it approximately true where you happened to have samples.

Equivariant Sheaf Neural Networks: Learning Geometric Transport on Graphs

33 minute read

Published:

Sheaf networks move features through matrix-valued maps but ignore the symmetries of physical space; equivariant GNNs respect those symmetries but move vectors with scalars. ESNN does both, learned, directed, matrix-valued transport that is exactly E(n)-equivariant, and proves that when displacement is the only geometric input, the radial–tangential family is all the linear transport there is.

Geometric Deep Learning: One Blueprint Behind Every Architecture

6 minute read

Published:

CNNs, GNNs, Transformers and sheaf models look like separate inventions. They are the same recipe applied to different domains: identify the symmetry of your data, then build layers that respect it. This book is that recipe, and the arguments that follow from it.

Convolutions and CNNs: Weight Sharing as a Prior

22 minute read

Published:

A dense layer from a 224-by-224 colour image to 1000 units holds 150.5 million weights; a 3-by-3, 64-filter convolution holds 1,792, and the two constraints that buy that factor of 84,000 are exactly the prior that makes it work on images.

Equivariance: What It Means and Why It Matters

9 minute read

Published:

Equivariance formalises the idea that a function should ‘commute with symmetry transformations.’ A rotation-equivariant model applied to rotated input gives the rotated output, no extra training needed. This is the foundation for geometric deep learning.

Sign Ambiguity in Laplacian Eigenvectors

9 minute read

Published:

Laplacian eigenvectors are only defined up to sign: if u is an eigenvector, so is -u. This seemingly minor issue creates a fundamental problem for learning with LapPE. Here is the problem, its consequences, and how SignNet solves it.

equivariant

Equivariant Sheaf Neural Networks

9 minute read

Published:

Sheaves with orthogonal restriction maps define a connection on the graph, a parallel transport structure over edges. This connects sheaf GNNs to differential geometry and enables equivariant processing of data with local coordinate frames at each node.

SE(3)-Transformers: Attention with 3D Symmetry

9 minute read

Published:

SE(3)-Transformers extend self-attention to 3D point clouds and molecular graphs while maintaining SE(3) equivariance. Attention weights are learned between node pairs; values are equivariant features built from spherical harmonics.

EGNN: E(n)-Equivariant Graph Neural Networks

9 minute read

Published:

EGNN achieves E(n)-equivariance with a simple update rule: positions updated via weighted sums of relative position vectors, features updated via invariant distances. No spherical harmonics needed.

estimation

Statistics Basics: Reasoning Backwards From Data to Model

5 minute read

Published:

Probability runs forwards: pick a model, predict the data. Statistics runs backwards, and backwards is harder, many models could have produced what you saw. Everything else in this book is machinery for handling that ambiguity honestly.

estimators

Estimators, Bias and Variance: Why Unbiased Is Not the Same as Good

6 minute read

Published:

An estimator is a random variable, so it has a mean and a spread. Squared error splits exactly into those two pieces, and once you see the split, it becomes obvious that deliberately biasing an estimator can make it strictly better.

euler-lagrange

Lagrangian Mechanics: Why Nature Optimises a Functional

6 minute read

Published:

Newton says a particle moves because a force pushes it. Lagrange says it moves along the path that makes the action stationary. The second statement is harder to believe and far easier to use, and it is the one machine learning inherited.

exceptions

Errors and Exceptions: EAFP, the Hierarchy, and Reading a Traceback

7 minute read

Published:

Exceptions in Python are not exceptional. They are a normal control-flow mechanism that the language leans on so heavily that the idiomatic style is to try the operation and handle the failure, rather than check first, which is faster, shorter, and free of race conditions.

expectation

Expectation and Variance: Linearity Is Free, Additivity Is Not

5 minute read

Published:

Expectation adds up no matter how tangled the dependence. Variance does not, and the correction term, covariance, is where most of the interesting behaviour of ensembles, portfolios and minibatch gradients lives.

expressiveness

GIN: Graph Isomorphism Network, The Most Expressive GNN

5 minute read

Published:

How powerful can a GNN be? Xu et al. (2019) answered with a theoretical bound, and GIN is the architecture that achieves it. The secret: use sum aggregation and an MLP, not mean or max.

expressivity

Message Passing on Simplicial Complexes

20 minute read

Published:

A simplex has four kinds of neighbour rather than one, and separating them lets a network see the difference between a filled triangle and an empty one, a distinction no graph neural network can make.

Diagonal, Orthogonal, and General Sheaf Maps

8 minute read

Published:

The restriction maps in a cellular sheaf can be constrained to different matrix classes: scalars, diagonal matrices, orthogonal matrices, or general matrices. Each class offers a different trade-off between expressivity and computational cost.

The Weisfeiler-Lehman Test: How Powerful Are GNNs?

11 minute read

Published:

The 1-WL graph isomorphism test provides the exact upper bound on message-passing GNN expressivity. GIN achieves this bound. Any pair of graphs that 1-WL cannot distinguish cannot be distinguished by any MPNN.

f-strings

fake-news

GNNs for Social Networks: Influence, Communities, and Misinformation

7 minute read

Published:

Social networks are large sparse graphs with rich node features (user profiles) and heterogeneous edges (friendship, follow, retweet). GNNs predict user behaviour, detect communities, identify influential spreaders, and flag misinformation, tasks with significant real-world impact.

fast-sampling

Distillation and Consistency Models: Getting to Four Steps

6 minute read

Published:

Better ODE solvers bottom out around ten evaluations because the trajectory is genuinely curved. To go lower you have to change the model, either teach a student to take two teacher steps at once, or train a network that jumps to the end of the trajectory from anywhere on it.

features

few-step-sampling

files

Files and Context Managers: Why with Is Not Optional

7 minute read

Published:

A file object that falls out of scope without with does get closed eventually, but ‘eventually’ means whenever the garbage collector gets around to it, which is not a promise any program handling more than a handful of files can live with.

fisher-information

floats

Names, Not Boxes: Python Syntax, Variables and the Built-in Types

7 minute read

Published:

A Python variable is not a container that holds a value, it is a label stuck onto an object that lives somewhere else. Almost every early surprise, from shared lists to 0.1 + 0.2, follows from taking that sentence literally.

flow-matching

Diffusion vs Flow Matching: Two Names for One Family

5 minute read

Published:

Flow matching is often presented as the successor to diffusion. It is more accurate, and more useful, to say that diffusion is one particular probability path inside the flow-matching framework, and not the straightest one available.

Flow Matching: Training a Velocity Field Without Ever Solving an ODE

7 minute read

Published:

Continuous normalising flows were elegant and nearly untrainable, every gradient step needed an ODE solve and a divergence estimate. Flow matching removes both by regressing a velocity field against a target you can write down in closed form, one example at a time.

fmri

BrainDyn: Sheaves Meet Neural ODEs for Brain Dynamics

11 minute read

Published:

Brain regions do not encode information in a shared feature space, which is exactly the assumption scalar message passing makes. BrainDyn puts learnable restriction maps between regions and integrates the result as a continuous-time system, the first pairing of cellular sheaves with neural ODEs.

fokker-planck

forecasting

GNNs for Traffic Forecasting

8 minute read

Published:

Traffic prediction is a canonical spatio-temporal graph task: sensors on roads form a fixed graph, and speed/volume measurements evolve over time. GNNs capture spatial correlations between sensors; RNNs or convolutions capture temporal patterns. Together they achieve state-of-the-art traffic forecasting.

Spatio-Temporal GNNs: Learning on Graphs Through Time

8 minute read

Published:

Spatio-temporal GNNs combine spatial message passing with temporal sequence modelling. They are the dominant approach for traffic forecasting, weather prediction, and any task where measurements at sensor nodes evolve over time on a fixed graph.

forward-process

The Forward Process: A Corruption Engineered to Be Jumped Into

6 minute read

Published:

The forward process looks like the trivial half of diffusion, but every term in it is load-bearing. Drop the shrink factor and the variance diverges; pick the wrong schedule and a third of your timesteps are spent denoising static.

foundations

Probability for ML Interviews: The Eight Ideas Worth Re-deriving

5 minute read

Published:

Almost every loss function in machine learning is a negative log-likelihood in disguise, and almost every model output is a distribution. This book rebuilds the probability you need to read those objects fluently, and flags the eight places interviewers know people slip.

framework

MPNN: The General Message Passing Neural Network Framework

6 minute read

Published:

The MPNN framework (Gilmer et al., 2017) unifies GCN, GAT, GIN, GraphSAGE, and almost all spatial GNNs under one abstraction: message functions, aggregation, and update. Understanding MPNN means understanding the whole GNN family.

Message Passing: The Universal GNN Framework

4 minute read

Published:

Every GNN, GCN, GAT, GraphSAGE, GIN, is a special case of message passing. Learn the three-step loop that defines them all: compute messages, aggregate, update.

free-energy

Entropy and Free Energy: From the Second Law to the ELBO

6 minute read

Published:

Thermodynamic entropy and Shannon entropy differ by a constant with units. Once you accept that, the ELBO stops being an inference trick and becomes a free energy, and diffusion models stop being a clever architecture and become a driven non-equilibrium process.

frequency-analysis

p-RoPE: What Makes Rotary Positional Encodings Useful?

6 minute read

Published:

This paper does two things at once: it explains what RoPE is really doing inside a trained LLM, and it proposes p-RoPE, a partial rotary variant that drops the lowest frequencies to preserve stronger semantic channels.

frequentist

Bayesian vs Frequentist: Two Meanings of the Word Probability

6 minute read

Published:

One school says probability is a long-run frequency, so parameters cannot have probabilities. The other says probability is a degree of belief, so they can. Everything else, priors, credible intervals, the whole argument, follows from that one disagreement.

functions

functools

fundamentals

The Graph Adjacency Matrix: A Graph in Matrix Form

4 minute read

Published:

Before understanding GNNs, you need to understand how graphs are represented mathematically. The adjacency matrix is the foundation, a simple grid that tells you which nodes are connected.

gat

Transformers Are GNNs on Fully Connected Graphs

6 minute read

Published:

Write self-attention in the message-passing template and you get the Graph Attention Network equations with one substitution: the neighbourhood becomes the whole input. The two architectures are not analogous, they are the same operator on different graphs.

GAT: Graph Attention Networks

5 minute read

Published:

GCN assigns the same (degree-based) weight to every neighbour. GAT learns which neighbours actually matter, using attention coefficients on edges. More expressive, more interpretable.

gauge-equivariance

Gauges: When There Is No Shared Frame

7 minute read

Published:

The previous chapter ended on an arbitrary choice that could not be eliminated. Gauge theory’s answer is to stop trying: keep every local frame, transport between them explicitly, and require the model to be indifferent to which frames you picked.

gauge-symmetry

Equivariant Sheaf Neural Networks

9 minute read

Published:

Sheaves with orthogonal restriction maps define a connection on the graph, a parallel transport structure over edges. This connects sheaf GNNs to differential geometry and enables equivariant processing of data with local coordinate frames at each node.

gaussian

gaussian-mixture

Clustering: What Each Algorithm Assumes a Cluster Is

29 minute read

Published:

k-means says a cluster is a ball around a centroid, DBSCAN says it is a connected dense region, and a Gaussian mixture says it is a bump in a density, pick the algorithm and you have already picked the answer.

gcn

GCN: Graph Convolutional Networks

5 minute read

Published:

GCN (Kipf & Welling, 2016) is the ‘hello world’ of GNNs. It simplifies spectral graph convolution into a single elegant layer: normalised neighbourhood averaging with a learned linear transformation.

gelu

general

Diagonal, Orthogonal, and General Sheaf Maps

8 minute read

Published:

The restriction maps in a cellular sheaf can be constrained to different matrix classes: scalars, diagonal matrices, orthogonal matrices, or general matrices. Each class offers a different trade-off between expressivity and computational cost.

generalisation

generative-ai

Z-SASLM: Zero-Shot Style Blending via Spherical Interpolation

9 minute read

Published:

Z-SASLM is a zero-shot, fine-tuning-free style blending pipeline that replaces linear latent interpolation with SLERP along the geodesic of the hypersphere, preserving latent manifold structure when blending multiple styles. Published at CVPR 2025 Workshop.

generative-models

Flow Matching: Training a Velocity Field Without Ever Solving an ODE

7 minute read

Published:

Continuous normalising flows were elegant and nearly untrainable, every gradient step needed an ODE solve and a divergence estimate. Flow matching removes both by regressing a velocity field against a target you can write down in closed form, one example at a time.

Diffusion Models: Learning to Undo Noise

4 minute read

Published:

Destroying an image is easy and needs no learning at all. Diffusion models exploit that asymmetry: they define a trivial forward corruption, then train a network to walk it backwards one small step at a time.

generators

geodesic-convolution

Geodesics: Learning on Curved Domains

6 minute read

Published:

On a surface there is no global grid to slide a filter along, and no canonical direction to call ‘up’. What survives is distance, and building convolution out of distance alone exposes exactly one ambiguity, which is where the next chapter starts.

geodesics

geometric

Equivariant Sheaf Neural Networks

9 minute read

Published:

Sheaves with orthogonal restriction maps define a connection on the graph, a parallel transport structure over edges. This connects sheaf GNNs to differential geometry and enables equivariant processing of data with local coordinate frames at each node.

geometric-deep-learning

Symmetry and Groups: Invariance, Equivariance, and Why You Build It In

6 minute read

Published:

If rotating a molecule cannot change its energy, that is a fact about the target function you know before training starts. Encoding it in the architecture makes it true everywhere; learning it from augmented data makes it approximately true where you happened to have samples.

Equivariant Sheaf Neural Networks: Learning Geometric Transport on Graphs

33 minute read

Published:

Sheaf networks move features through matrix-valued maps but ignore the symmetries of physical space; equivariant GNNs respect those symmetries but move vectors with scalars. ESNN does both, learned, directed, matrix-valued transport that is exactly E(n)-equivariant, and proves that when displacement is the only geometric input, the radial–tangential family is all the linear transport there is.

Gauges: When There Is No Shared Frame

7 minute read

Published:

The previous chapter ended on an arbitrary choice that could not be eliminated. Gauge theory’s answer is to stop trying: keep every local frame, transport between them explicitly, and require the model to be indifferent to which frames you picked.

Geodesics: Learning on Curved Domains

6 minute read

Published:

On a surface there is no global grid to slide a filter along, and no canonical direction to call ‘up’. What survives is distance, and building convolution out of distance alone exposes exactly one ambiguity, which is where the next chapter starts.

Groups: Equivariance Beyond Translation

6 minute read

Published:

Translation is one group. Swap it for rotations, reflections, or the rigid motions of 3-D space and the same construction produces a different architecture, with the parameter count cut by exactly the size of the orbit.

Grids: Why Translation Equivariance Forces Convolution

5 minute read

Published:

Convolution is not a clever idea someone had about images. It is the only linear map that commutes with translation, a theorem, not a design choice, and one you can verify by exhaustion on a small enough case.

The Hardware Lottery: Why the Dense Version Won

6 minute read

Published:

Message passing on a sparse graph does asymptotically less work than attention over every pair. It is still the slower one to train. This chapter is about why the architecture that wins is the one your hardware happens to like.

Transformers Are GNNs on Fully Connected Graphs

6 minute read

Published:

Write self-attention in the message-passing template and you get the Graph Attention Network equations with one substitution: the neighbourhood becomes the whole input. The two architectures are not analogous, they are the same operator on different graphs.

Permutation Symmetry and the Message-Passing Blueprint

7 minute read

Published:

A graph’s nodes have no canonical order, so any model that reads one must give the same answer under relabelling. That single requirement forces the three-step message, aggregate, update template, it is not a design choice.

Geometric Deep Learning: One Blueprint Behind Every Architecture

6 minute read

Published:

CNNs, GNNs, Transformers and sheaf models look like separate inventions. They are the same recipe applied to different domains: identify the symmetry of your data, then build layers that respect it. This book is that recipe, and the arguments that follow from it.

Tensor Field Networks and Geometric Deep Learning

8 minute read

Published:

Tensor Field Networks (TFN) were the first architecture to achieve SE(3) equivariance using spherical harmonics and Clebsch-Gordan tensor products. They laid the theoretical foundation for NequIP and MACE, the current state-of-the-art in equivariant molecular force fields.

geometry

Euclidean Space: Inner Products, Projections and the Margin

6 minute read

Published:

One bilinear form generates the whole of flat geometry: lengths, angles, orthogonality, projections and the distance from a point to a hyperplane. Get the projection formula and you get the SVM margin for free.

Geometry for Machine Learning: Why Shape Keeps Coming Back

5 minute read

Published:

Every embedding you have ever trained lives in a metric space, every dataset you have ever fitted sits near a surface far thinner than its ambient dimension, and every architecture you trust encodes a symmetry. Geometry is not decoration on top of ML, it is what makes the problems tractable.

Why Geometry Matters in Graph Neural Networks

7 minute read

Published:

Many real-world graphs are embedded in 3D space, molecules, proteins, point clouds, crystal structures. Standard GNNs ignore coordinates and only use connectivity. Geometric GNNs incorporate spatial positions and must respect physical symmetries.

gil

gin

GIN: Graph Isomorphism Network, The Most Expressive GNN

5 minute read

Published:

How powerful can a GNN be? Xu et al. (2019) answered with a theoretical bound, and GIN is the architecture that achieves it. The secret: use sum aggregation and an MLP, not mean or max.

global-attention

Graph Transformers: Bringing Attention to Graphs

6 minute read

Published:

Graph Transformers replace or augment local message passing with full pairwise attention, every node attends to every other node. This solves long-range dependencies and over-squashing at the cost of O(N²) computation.

global-pooling

Global Pooling in GNNs: Mean, Sum, and Max

6 minute read

Published:

To predict a property of an entire graph, node embeddings must be aggregated into a single vector. The choice of global pooling, mean, sum, or max, is not arbitrary: each has distinct expressive power and fits different tasks.

global-sections

What Is a Sheaf? From Topology to Graph Learning

8 minute read

Published:

A sheaf is a mathematical object from algebraic topology that assigns vector spaces to cells and linear maps between them. On graphs, sheaves assign feature spaces to nodes and edges, with restriction maps encoding how node features relate across edges.

glu

Output and Gated Activations: Softmax, Sparsemax, GLU, and SIREN

6 minute read

Published:

The last activation in your network is not a modelling preference, it is a contract with your loss function. Break it and training stops meaning anything. Here is the contract, and what changes when the activation itself becomes learned.

gnn

Transformers Are GNNs on Fully Connected Graphs

6 minute read

Published:

Write self-attention in the message-passing template and you get the Graph Attention Network equations with one substitution: the neighbourhood becomes the whole input. The two architectures are not analogous, they are the same operator on different graphs.

Permutation Symmetry and the Message-Passing Blueprint

7 minute read

Published:

A graph’s nodes have no canonical order, so any model that reads one must give the same answer under relabelling. That single requirement forces the three-step message, aggregate, update template, it is not a design choice.

gradient-boosting

Trees, Forests, and Boosting: Axis-Aligned Everything

15 minute read

Published:

A decision tree chops feature space into axis-aligned boxes and predicts one number per box, which explains why it needs no feature scaling, why it approximates a diagonal boundary as a staircase, and why it cannot extrapolate a single step beyond the training range.

gradient-descent

Convexity: What It Guarantees, and Why Deep Learning Works Without It

8 minute read

Published:

Convexity buys one enormous guarantee, every local minimum is global, and it says nothing at all about speed. Deep learning throws the guarantee away and still works, and it is worth being precise about how much of that we actually understand.

Gradient Descent and Backpropagation: How a Model Learns

27 minute read

Published:

Training is one loop: measure the loss, ask backpropagation which way is downhill, take a small step. This chapter derives exactly how small that step has to be, why the answer is 2/a for a quadratic, and why reverse-mode differentiation gets you every gradient for roughly the price of one forward pass.

gradient-flow

Residual Connections: Why Transformers Can Be Deep

7 minute read

Published:

Without residual connections, training a 96-layer Transformer would be practically impossible. The skip connection is a simple addition that solves the vanishing gradient problem and enables arbitrary depth.

gradients

The Derivative Is a Linear Approximation, and the Gradient Is a Covector

6 minute read

Published:

Treating the derivative as a slope stops working the moment there is more than one input. Treating it as the best linear approximation keeps working forever, and makes backpropagation an obvious consequence of the chain rule rather than an algorithm to memorise.

graph

GAT: Graph Attention Networks

5 minute read

Published:

GCN assigns the same (degree-based) weight to every neighbour. GAT learns which neighbours actually matter, using attention coefficients on edges. More expressive, more interpretable.

The Graph Laplacian: Spectral Graph Theory Explained Simply

6 minute read

Published:

The Graph Laplacian is L = D - A. Its eigenvectors reveal the graph’s community structure; its eigenvalues tell you how well-connected the graph is. It’s also the mathematical bridge from spectral theory to GNNs like GCN.

The Graph Adjacency Matrix: A Graph in Matrix Form

4 minute read

Published:

Before understanding GNNs, you need to understand how graphs are represented mathematically. The adjacency matrix is the foundation, a simple grid that tells you which nodes are connected.

Graph Neural Networks: Learning on Graphs

5 minute read

Published:

Graphs are everywhere, molecules, social networks, road maps, knowledge bases. Graph Neural Networks learn from this relational structure by propagating information between connected nodes. Here’s the complete picture.

graph-classification

SheafPool: Basis-Invariant Graph Readout for Sheaf Neural Networks

8 minute read

Published:

SheafPool solves a key missing piece in sheaf GNNs: graph-level pooling. Instead of averaging stalk vectors in arbitrary local bases, it aligns them into a shared canonical frame and builds a readout that is invariant to local basis changes.

Graph Classification: From Node Embeddings to Graph Embeddings

7 minute read

Published:

Graph classification is the task of predicting a label for an entire graph. It requires composing message passing (node embeddings), readout (graph embedding), and a classifier, and all three choices interact to determine model expressiveness.

Set2Set and Attention Readout: Order-Invariant Graph Summaries

8 minute read

Published:

Mean and sum readout treat all nodes equally. Attention readout learns which nodes matter most for a given task. Set2Set goes further, it uses an LSTM to iteratively query the node set, producing richer graph representations than single-pass pooling.

TopKPool and SAGPool: Sparse Graph Pooling

8 minute read

Published:

Instead of soft cluster assignment (DiffPool), TopKPool and SAGPool select a subset of the most important nodes, producing a smaller but sparser graph at each level. Hard selection is scalable but requires careful score learning.

DiffPool: Learning Hierarchical Graph Pooling

8 minute read

Published:

DiffPool learns to hierarchically cluster nodes into super-nodes across layers, like a convolutional pyramid for graphs. Unlike flat global pooling, it captures multi-scale graph structure by differentiably assigning nodes to clusters.

Global Pooling in GNNs: Mean, Sum, and Max

6 minute read

Published:

To predict a property of an entire graph, node embeddings must be aggregated into a single vector. The choice of global pooling, mean, sum, or max, is not arbitrary: each has distinct expressive power and fits different tasks.

Graph Tasks: Node, Edge, and Graph-Level Prediction

7 minute read

Published:

GNNs can predict at three levels: properties of individual nodes, existence or type of edges, or properties of entire graphs. Each level requires a different output head and training setup.

graph-convolution

SGC: Simple Graph Convolution

7 minute read

Published:

SGC removes all nonlinearities between GCN layers and collapses the entire propagation into a single pre-computed matrix power. Surprisingly, it matches GCN on most benchmarks, revealing that nonlinearities between layers may be unnecessary.

graph-dynamics

Graph Neural ODEs: Continuous-Time Graph Dynamics

9 minute read

Published:

Neural ODEs replace discrete layer-by-layer computation with continuous dynamics governed by a differential equation. Graph Neural ODEs apply this to graph data, treating node embeddings as a dynamical system evolving in continuous time.

graph-isomorphism

The Weisfeiler-Lehman Test: How Powerful Are GNNs?

11 minute read

Published:

The 1-WL graph isomorphism test provides the exact upper bound on message-passing GNN expressivity. GIN achieves this bound. Any pair of graphs that 1-WL cannot distinguish cannot be distinguished by any MPNN.

graph-learning

Sheaf Neural Networks: A Complete Research Guide

9 minute read

Published:

Standard GNNs assume neighbouring nodes should agree. Sheaf Neural Networks replace that assumption with a learned linear map on every edge, which turns heterophily, oversmoothing, and directional structure into one operator: the sheaf Laplacian.

graph-neural-networks

DNSD: Making Sheaf Diffusion Work at Depth

12 minute read

Published:

Neural Sheaf Diffusion has a theoretical guarantee against representation collapse that does not survive contact with depth. DNSD diagnoses why, the Laplacian’s disagreement signal vanishes as diffusion succeeds, and replaces the operator rather than patching around it.

PolyNSD: Polynomial Neural Sheaf Diffusion

10 minute read

Published:

PolyNSD replaces the NSD propagation operator with a degree-K Chebyshev polynomial in the normalised sheaf Laplacian, achieving SOTA on homo- and heterophilic benchmarks with only diagonal restriction maps and dramatically lower memory usage.

HetSheaf: Heterogeneous Graphs Meet Cellular Sheaves

9 minute read

Published:

HetSheaf encodes graph heterogeneity directly in the sheaf data structure, type-aware stalks and restriction maps conditioned on node and edge types, instead of specialised architectural components, achieving +2pp on HGB with 10× fewer parameters.

graph-regression

Graph Tasks: Node, Edge, and Graph-Level Prediction

7 minute read

Published:

GNNs can predict at three levels: properties of individual nodes, existence or type of edges, or properties of entire graphs. Each level requires a different output head and training setup.

graph-rewiring

graph-signal

Graph Fourier Transform: The Spectral View of Graphs

8 minute read

Published:

The Graph Fourier Transform decomposes a signal on a graph into frequency components using the Laplacian’s eigenvectors. This spectral view is the mathematical foundation behind spectral GNNs like ChebNet and GCN.

graph-theory

graph-transformer

Laplacian Eigenvectors as Graph Positional Encodings

11 minute read

Published:

The k smallest eigenvectors of the graph Laplacian form a natural positional embedding space, the graph’s own coordinate system. They capture global structure, symmetry, and community membership.

Graphormer: Transformers with Structural Biases for Graphs

9 minute read

Published:

Graphormer encodes graph structure directly into Transformer attention via three biases: node centrality, spatial encoding (shortest paths), and edge encoding. It won the OGB-LSC 2021 competition on molecular property prediction.

Graph Transformers: Bringing Attention to Graphs

6 minute read

Published:

Graph Transformers replace or augment local message passing with full pairwise attention, every node attends to every other node. This solves long-range dependencies and over-squashing at the cost of O(N²) computation.

graph-transformers

Sheaf-Based Positional Encodings: Letting Node Features Into the Spectrum

12 minute read

Published:

Laplacian eigenvector positional encodings tell a node where it sits in the graph, but the graph Laplacian only knows adjacency, so two structurally identical nodes get identical encodings no matter how different their features are. Swap in the sheaf Laplacian and the features enter the spectrum.

graph-types

graphs

graphsage

GraphSAGE: Inductive Learning on Large Graphs

4 minute read

Published:

GCN and GAT learn embeddings for fixed graphs, add a new node and you’re stuck. GraphSAGE (Hamilton et al., 2017) learns an aggregation function instead, so it can generate embeddings for entirely new nodes at inference time.

grids

Grids: Why Translation Equivariance Forces Convolution

5 minute read

Published:

Convolution is not a clever idea someone had about images. It is the only linear map that commutes with translation, a theorem, not a design choice, and one you can verify by exhaustion on a small enough case.

group-equivariance

Groups: Equivariance Beyond Translation

6 minute read

Published:

Translation is one group. Swap it for rotations, reflections, or the rigid motions of 3-D space and the same construction produces a different architecture, with the parameter count cut by exactly the size of the orbit.

group-theory

Equivariance: What It Means and Why It Matters

9 minute read

Published:

Equivariance formalises the idea that a function should ‘commute with symmetry transformations.’ A rotation-equivariant model applied to rotated input gives the rotated output, no extra training needed. This is the foundation for geometric deep learning.

groups

Symmetry and Groups: Invariance, Equivariance, and Why You Build It In

6 minute read

Published:

If rotating a molecule cannot change its energy, that is a fact about the target function you know before training starts. Encoding it in the architecture makes it true everywhere; learning it from augmented data makes it approximately true where you happened to have samples.

gru

RNNs, LSTMs, and GRUs: Sequence Models Before Attention

6 minute read

Published:

A recurrent network shares weights across time exactly as a convolution shares them across space. The trouble is that gradients then travel through a product of Jacobians, and a product of a hundred numbers slightly below one is zero.

guidance

hamiltonian

Hamiltonian Dynamics: Phase Space, Liouville, and Why HMC Works

6 minute read

Published:

Hamiltonian Monte Carlo is not a heuristic that happens to move well. It is exact because Hamiltonian flow preserves phase-space volume and is reversible, which is what makes the Metropolis acceptance ratio collapse to a difference of energies.

hardware-lottery

The Hardware Lottery: Why the Dense Version Won

6 minute read

Published:

Message passing on a sparse graph does asymptotically less work than attention over every pair. It is still the slower one to train. This chapter is about why the architecture that wins is the one your hardware happens to like.

hash-tables

hashing

Dicts and Sets: Hashing, Defaults, and What Makes a Key Legal

7 minute read

Published:

A dict trades memory for the ability to skip the search entirely. Everything that follows, why keys must be hashable, why lists cannot be keys, and why 1, 1.0 and True collide, comes from that single trade.

heaps

hessian

Jacobians, Hessians, and Why Newton’s Method Loses at Scale

7 minute read

Published:

The Jacobian tells you how a map distorts volume, which is exactly the term normalising flows have to pay. The Hessian tells you the shape of the valley you are descending. Both are indispensable to reason with and, at a billion parameters, hopeless to form.

heterogeneous

HAN: Heterogeneous Graph Attention Networks

6 minute read

Published:

HAN combines meta-path decomposition with two levels of attention: node-level attention weights neighbours along a meta-path, and semantic-level attention weights different meta-paths. This lets the model learn which relationships matter most for a given task.

heterogeneous-graph

Heterogeneous Graphs: When Nodes and Edges Have Types

5 minute read

Published:

Most real-world graphs are heterogeneous, they contain multiple node types (users, items, tags) and edge types (clicks, rates, authors). Standard GNNs treat all nodes and edges identically, making them blind to this type structure.

heterogeneous-graphs

SheafPool: Basis-Invariant Graph Readout for Sheaf Neural Networks

8 minute read

Published:

SheafPool solves a key missing piece in sheaf GNNs: graph-level pooling. Instead of averaging stalk vectors in arbitrary local bases, it aligns them into a shared canonical frame and builds a readout that is invariant to local basis changes.

HetSheaf: Heterogeneous Graphs Meet Cellular Sheaves

9 minute read

Published:

HetSheaf encodes graph heterogeneity directly in the sheaf data structure, type-aware stalks and restriction maps conditioned on node and edge types, instead of specialised architectural components, achieving +2pp on HGB with 10× fewer parameters.

heterophily

Joint Diffusion and Rotation Invariance: Sheaves That Learn to Lie

12 minute read

Published:

Every sheaf network so far predicts restriction maps with an MLP on concatenated features, a universal approximator with no inductive bias for heterophily at all. Two alternatives drawn from opinion dynamics get the bias for free, and stop the parameter count scaling with the feature dimension.

Sheaf-Based Positional Encodings: Letting Node Features Into the Spectrum

12 minute read

Published:

Laplacian eigenvector positional encodings tell a node where it sits in the graph, but the graph Laplacian only knows adjacency, so two structurally identical nodes get identical encodings no matter how different their features are. Swap in the sheaf Laplacian and the features enter the spectrum.

Surfing on the Neural Sheaf: What Happens If You Use the Wave Equation

9 minute read

Published:

Every sheaf model so far discretises the heat equation, which dissipates energy. Suk et al. try the wave equation instead, which conserves it, a one-line change of PDE with a clean theoretical motivation and a genuinely mixed empirical result.

DNSD: Making Sheaf Diffusion Work at Depth

12 minute read

Published:

Neural Sheaf Diffusion has a theoretical guarantee against representation collapse that does not survive contact with depth. DNSD diagnoses why, the Laplacian’s disagreement signal vanishes as diffusion succeeds, and replaces the operator rather than patching around it.

Sheaf Neural Networks: A Complete Research Guide

9 minute read

Published:

Standard GNNs assume neighbouring nodes should agree. Sheaf Neural Networks replace that assumption with a learned linear map on every edge, which turns heterophily, oversmoothing, and directional structure into one operator: the sheaf Laplacian.

Sheaf Neural Networks and Heterophily

9 minute read

Published:

Sheaf GNNs are the principled solution to heterophily: by learning per-edge maps that transform features before comparison, they can perform diffusion that converges within classes and diverges across classes, the exact opposite of standard GCN’s collapse.

Neural Sheaf Diffusion: Learning Sheaves End-to-End

10 minute read

Published:

Neural Sheaf Diffusion (Bodnar et al., 2022) learns the sheaf restriction maps from data using a neural network, then performs diffusion with the learned Sheaf Laplacian. This gives a principled, topology-grounded GNN that handles heterophily without heuristic fixes.

Why Message Passing Is Not Enough: The Case for Sheaves

7 minute read

Published:

Standard message passing aggregates neighbour features and averages. On heterophilic graphs (where neighbours often disagree), this is harmful. Cellular sheaves provide a mathematically principled framework to model per-edge relationships between node features, going beyond mere averaging.

hierarchical

Clustering: What Each Algorithm Assumes a Cluster Is

29 minute read

Published:

k-means says a cluster is a ball around a centroid, DBSCAN says it is a connected dense region, and a Gaussian mixture says it is a bump in a density, pick the algorithm and you have already picked the answer.

hierarchical-pooling

DiffPool: Learning Hierarchical Graph Pooling

8 minute read

Published:

DiffPool learns to hierarchically cluster nodes into super-nodes across layers, like a convolutional pyramid for graphs. Unlike flat global pooling, it captures multi-scale graph structure by differentiably assigning nodes to clusters.

higher-order

Sheaf Hypergraph Networks: Apparent Consensus in Higher-Order Relations

13 minute read

Published:

A graph edge relates two things. A hyperedge relates any number of them, and hypergraph networks aggregate over it uniformly, every member contributes the same way. Attaching a sheaf gives each member its own linear map into the group, and turns forced consensus into apparent consensus.

Beyond Simplices: Cell and Combinatorial Complexes

20 minute read

Published:

A simplicial complex cannot hold a benzene ring as a single cell, filling the hexagon costs three edges between atoms that share no bond, and this one constraint is what cell and combinatorial complexes exist to remove.

Topological Deep Learning Is Not Topological Data Analysis

17 minute read

Published:

TDA computes a topological descriptor and hands it to a model; TDL makes the topological object the domain the model runs on. Telling the two apart is the difference between a preprocessing step and an architecture.

historical-reasoning

Temporal Knowledge Graphs: Facts That Change Over Time

7 minute read

Published:

Most knowledge graphs treat facts as timeless, but facts change. Barack Obama was president from 2009 to 2017. Temporal Knowledge Graphs add timestamps to triples, requiring models to reason about what was true when.

hodge-laplacian

Message Passing on Simplicial Complexes

20 minute read

Published:

A simplex has four kinds of neighbour rather than one, and separating them lets a network see the difference between a filled triangle and an empty one, a distinction no graph neural network can make.

holonomy

Gauges: When There Is No Shared Frame

7 minute read

Published:

The previous chapter ended on an arbitrary choice that could not be eliminated. Gauge theory’s answer is to stop trying: keep every local frame, transport between them explicitly, and require the model to be indifferent to which frames you picked.

homophily

hyperbolic-embeddings

hypergraphs

Sheaf Hypergraph Networks: Apparent Consensus in Higher-Order Relations

13 minute read

Published:

A graph edge relates two things. A hyperedge relates any number of them, and hypergraph networks aggregate over it uniformly, every member contributes the same way. Attaching a sheaf gives each member its own linear map into the group, and turns forced consensus into apparent consensus.

Beyond Simplices: Cell and Combinatorial Complexes

20 minute read

Published:

A simplicial complex cannot hold a benzene ring as a single cell, filling the hexagon costs three edges between atoms that share no bond, and this one constraint is what cell and combinatorial complexes exist to remove.

Topological Deep Learning Is Not Topological Data Analysis

17 minute read

Published:

TDA computes a topological descriptor and hands it to a model; TDL makes the topological object the domain the model runs on. Telling the two apart is the difference between a preprocessing step and an architecture.

hypothesis-testing

Hypothesis Testing: What a p-Value Actually Measures

7 minute read

Published:

A p-value answers one narrow question: if nothing were going on, how often would data look at least this extreme? It says nothing about whether the effect is real, large, or worth shipping, and running twenty of them changes the meaning of all twenty.

idiomatic

imports

Modules, Packages, and How Python Actually Finds Your Code

7 minute read

Published:

An import is not a textual include, it executes a file once, caches the result, and binds a name. Almost every confusing import error, from circular imports to ‘attempted relative import with no known parent package’, follows directly from that one sentence.

independence

indistinguishability

inductive

GraphSAGE: Inductive Learning on Large Graphs

4 minute read

Published:

GCN and GAT learn embeddings for fixed graphs, add a new node and you’re stuck. GraphSAGE (Hamilton et al., 2017) learns an aggregation function instead, so it can generate embeddings for entirely new nodes at inference time.

inductive-bias

Joint Diffusion and Rotation Invariance: Sheaves That Learn to Lie

12 minute read

Published:

Every sheaf network so far predicts restriction maps with an MLP on concatenated features, a universal approximator with no inductive bias for heterophily at all. Two alternatives drawn from opinion dynamics get the bias for free, and stop the parameter count scaling with the feature dimension.

inference

Statistics Basics: Reasoning Backwards From Data to Model

5 minute read

Published:

Probability runs forwards: pick a model, predict the data. Statistics runs backwards, and backwards is harder, many models could have produced what you saw. Everything else in this book is machinery for handling that ambiguity honestly.

influence

GNNs for Social Networks: Influence, Communities, and Misinformation

7 minute read

Published:

Social networks are large sparse graphs with rich node features (user profiles) and heterogeneous edges (friendship, follow, retweet). GNNs predict user behaviour, detect communities, identify influential spreaders, and flag misinformation, tasks with significant real-world impact.

inheritance

Classes and Objects: self, Attributes, and When Inheritance Is the Wrong Tool

6 minute read

Published:

A Python class is a factory for namespaces, not a sealed blueprint. Once you see where an attribute actually lives, on the instance or on the class, the mutable-default trap, the point of self, and the reason composition usually beats inheritance all fall out of the same rule.

inner-products

Norms, Inner Products, and the Geometry Behind L1 Sparsity

7 minute read

Published:

L1 regularisation produces exact zeros and L2 does not. The reason is not statistical, it is geometric: the L1 unit ball has corners on the axes, and corners are what optimisation solutions stick to.

inpainting

interpolation

interview-prep

What Mathematics an ML Engineer Actually Needs

5 minute read

Published:

Almost every mathematical question asked in an ML interview reduces to two things: what a matrix does to space, and how to differentiate a composition. This book covers those two things properly and is honest about what you can safely forget.

interviews

Probability for ML Interviews: The Eight Ideas Worth Re-deriving

5 minute read

Published:

Almost every loss function in machine learning is a negative log-likelihood in disguise, and almost every model output is a distribution. This book rebuilds the probability you need to read those objects fluently, and flags the eight places interviewers know people slip.

intuition

Query, Key, Value: The Intuition Behind QKV

6 minute read

Published:

Q, K, and V are not arbitrary labels. They map precisely onto search queries, database labels, and retrieved content, a framework you already understand.

invariance

Symmetry and Groups: Invariance, Equivariance, and Why You Build It In

6 minute read

Published:

If rotating a molecule cannot change its energy, that is a fact about the target function you know before training starts. Encoding it in the architecture makes it true everywhere; learning it from augmented data makes it approximately true where you happened to have samples.

Equivariance: What It Means and Why It Matters

9 minute read

Published:

Equivariance formalises the idea that a function should ‘commute with symmetry transformations.’ A rotation-equivariant model applied to rotated input gives the rotated output, no extra training needed. This is the foundation for geometric deep learning.

irreps

SE(3)-Transformers: Attention with 3D Symmetry

9 minute read

Published:

SE(3)-Transformers extend self-attention to 3D point clouds and molecular graphs while maintaining SE(3) equivariance. Attention weights are learned between node pairs; values are equivariant features built from spherical harmonics.

iterators

itertools

jacobian

Jacobians, Hessians, and Why Newton’s Method Loses at Scale

7 minute read

Published:

The Jacobian tells you how a map distorts volume, which is exactly the term normalising flows have to pay. The Hessian tells you the shape of the valley you are descending. Both are indispensable to reason with and, at a billion parameters, hopeless to form.

json

Files and Context Managers: Why with Is Not Optional

7 minute read

Published:

A file object that falls out of scope without with does get closed eventually, but ‘eventually’ means whenever the garbage collector gets around to it, which is not a promise any program handling more than a handful of files can live with.

k-means

Clustering: What Each Algorithm Assumes a Cluster Is

29 minute read

Published:

k-means says a cluster is a ball around a centroid, DBSCAN says it is a connected dense region, and a Gaussian mixture says it is a bump in a density, pick the algorithm and you have already picked the answer.

kernel-trick

Support Vector Machines: Margins and the Kernel Trick

8 minute read

Published:

Among all the hyperplanes that separate two classes, one sits furthest from both. Finding it turns out to depend on the data only through inner products, and that single fact is what lets you work in a space you never build.

key-value memory

kkt

Convexity: What It Guarantees, and Why Deep Learning Works Without It

8 minute read

Published:

Convexity buys one enormous guarantee, every local minimum is global, and it says nothing at all about speed. Deep learning throws the guarantee away and still works, and it is worth being precise about how much of that we actually understand.

kl-divergence

knowledge-graph

GNNs for Knowledge Graphs: Reasoning and Completion

8 minute read

Published:

Knowledge graphs encode human knowledge as typed entity-relation triples. GNNs enable structure-aware entity representation, multi-hop reasoning, knowledge base completion, and entity alignment, tasks that shallow embedding methods cannot fully solve.

Knowledge Graph Embeddings vs GNNs

11 minute read

Published:

Knowledge graph completion can be solved with shallow KG embeddings (TransE, DistMult, ComplEx) or with structural GNNs (R-GCN, CompGCN). Each approach has different inductive biases and failure modes. Understanding when to use each is the central design decision for KG tasks.

R-GCN: Relational Graph Convolutional Networks

7 minute read

Published:

R-GCN extends GCN to multi-relational graphs by learning a separate weight matrix for each relation type. It handles knowledge graphs with typed edges and powers both entity classification and link prediction tasks.

Heterogeneous Graphs: When Nodes and Edges Have Types

5 minute read

Published:

Most real-world graphs are heterogeneous, they contain multiple node types (users, items, tags) and edge types (clicks, rates, authors). Standard GNNs treat all nodes and edges identically, making them blind to this type structure.

labels

landing-probability

Random Walk Positional Encodings

7 minute read

Published:

Random walk positional encodings encode each node’s structural context by computing the probability of returning to it from itself in k steps, a computationally efficient alternative to Laplacian eigenvectors with no sign ambiguity.

langevin

laplace-beltrami

Geodesics: Learning on Curved Domains

6 minute read

Published:

On a surface there is no global grid to slide a filter along, and no canonical direction to call ‘up’. What survives is distance, and building convolution out of distance alone exposes exactly one ambiguity, which is where the next chapter starts.

laplacian

The Graph Laplacian: Spectral Graph Theory Explained Simply

6 minute read

Published:

The Graph Laplacian is L = D - A. Its eigenvectors reveal the graph’s community structure; its eigenvalues tell you how well-connected the graph is. It’s also the mathematical bridge from spectral theory to GNNs like GCN.

lasso

Linear Regression: Least Squares as Projection

20 minute read

Published:

Fitting a line by least squares is not an optimisation trick, it is the orthogonal projection of the observation vector onto the column space of the design matrix, and once you see that, the normal equations, the failure modes, and the reason we solve by QR instead of inverting all follow from one picture.

latent-ODE

Graph Neural ODEs: Continuous-Time Graph Dynamics

9 minute read

Published:

Neural ODEs replace discrete layer-by-layer computation with continuous dynamics governed by a differential equation. Graph Neural ODEs apply this to graph data, treating node embeddings as a dynamical system evolving in continuous time.

latent-diffusion

Latent Diffusion: Denoise Where the Information Is

6 minute read

Published:

Most of the bits in a photograph encode texture no one can see. Latent diffusion throws them away first with an autoencoder, then runs the entire diffusion process in a space roughly forty-eight times smaller, which is how Stable Diffusion fits on a consumer GPU.

latent-space

DDIM: Same Marginals, Fewer Steps, and a Latent Space Worth Having

5 minute read

Published:

DDPM’s objective never actually required the forward process to be Markov, only that its marginals be Gaussian. Dropping the Markov assumption exposes a whole family of samplers a trained model already supports, including a deterministic one that runs in 20 steps and gives an invertible latent space.

Z-SASLM: Zero-Shot Style Blending via Spherical Interpolation

9 minute read

Published:

Z-SASLM is a zero-shot, fine-tuning-free style blending pipeline that replaces linear latent interpolation with SLERP along the geodesic of the hypersphere, preserving latent manifold structure when blending multiple styles. Published at CVPR 2025 Workshop.

layer-norm

The Transformer Block: Putting It All Together

6 minute read

Published:

A single Transformer block combines attention, residuals, layer norm, and an FFN into one reusable unit. Understanding this block is understanding the Transformer.

Layer Normalization in Transformers

6 minute read

Published:

Layer norm is not optional plumbing. It determines training stability, gradient flow, and whether deep Transformers converge at all. Pre-LN vs Post-LN is not a detail, it changes training dynamics fundamentally.

layout-convention

learned

Learned Positional Encodings: Data-Driven Position

3 minute read

Published:

Instead of a fixed formula, why not just train position embeddings from scratch, like word embeddings? That’s exactly what BERT and GPT-1 do. Here’s how and when it works.

learned-maps

learned-sheaf

Neural Sheaf Diffusion: Learning Sheaves End-to-End

10 minute read

Published:

Neural Sheaf Diffusion (Bodnar et al., 2022) learns the sheaf restriction maps from data using a neural network, then performs diffusion with the learned Sheaf Laplacian. This gives a principled, topology-grounded GNN that handles heterophily without heuristic fixes.

least-squares

Linear Regression: Least Squares as Projection

20 minute read

Published:

Fitting a line by least squares is not an optimisation trick, it is the orthogonal projection of the observation vector onto the column space of the design matrix, and once you see that, the normal equations, the failure modes, and the reason we solve by QR instead of inverting all follow from one picture.

limitations

Why Message Passing Is Not Enough: The Case for Sheaves

7 minute read

Published:

Standard message passing aggregates neighbour features and averages. On heterophilic graphs (where neighbours often disagree), this is harmful. Cellular sheaves provide a mathematically principled framework to model per-edge relationships between node features, going beyond mere averaging.

linear

SGC: Simple Graph Convolution

7 minute read

Published:

SGC removes all nonlinearities between GCN layers and collapses the entire propagation into a single pre-computed matrix power. Surprisingly, it matches GCN on most benchmarks, revealing that nonlinearities between layers may be unnecessary.

linear-algebra

Linear Maps as Geometry: Rotate, Scale, Rotate

6 minute read

Published:

A matrix is not a table of numbers, it is a deformation of space. The SVD says every deformation is the same three moves in sequence: rotate, stretch along axes, rotate again.

Euclidean Space: Inner Products, Projections and the Margin

6 minute read

Published:

One bilinear form generates the whole of flat geometry: lengths, angles, orthogonality, projections and the distance from a point to a hyperplane. Get the projection formula and you get the SVM margin for free.

Matrices as Linear Maps: Span, Rank, and the Subspaces They Create

7 minute read

Published:

A matrix is not a grid of numbers, it is a map. Once you read it that way, rank, column space, null space and rank–nullity stop being definitions to memorise and become one geometric statement about what the map keeps and what it destroys.

What Mathematics an ML Engineer Actually Needs

5 minute read

Published:

Almost every mathematical question asked in an ML interview reduces to two things: what a matrix does to space, and how to differentiate a composition. This book covers those two things properly and is honest about what you can safely forget.

linear-regression

Linear Regression: Least Squares as Projection

20 minute read

Published:

Fitting a line by least squares is not an optimisation trick, it is the orthogonal projection of the observation vector onto the column space of the design matrix, and once you see that, the normal equations, the failure modes, and the reason we solve by QR instead of inverting all follow from one picture.

GNNs for Social Networks: Influence, Communities, and Misinformation

7 minute read

Published:

Social networks are large sparse graphs with rich node features (user profiles) and heterogeneous edges (friendship, follow, retweet). GNNs predict user behaviour, detect communities, identify influential spreaders, and flag misinformation, tasks with significant real-world impact.

Temporal Graph Networks: Learning from Events

8 minute read

Published:

TGN (Temporal Graph Network) is the leading framework for continuous-time dynamic graphs. It maintains a per-node memory that is updated upon each interaction, enabling efficient inductive link prediction on event streams.

Temporal Knowledge Graphs: Facts That Change Over Time

7 minute read

Published:

Most knowledge graphs treat facts as timeless, but facts change. Barack Obama was president from 2009 to 2017. Temporal Knowledge Graphs add timestamps to triples, requiring models to reason about what was true when.

Knowledge Graph Embeddings vs GNNs

11 minute read

Published:

Knowledge graph completion can be solved with shallow KG embeddings (TransE, DistMult, ComplEx) or with structural GNNs (R-GCN, CompGCN). Each approach has different inductive biases and failure modes. Understanding when to use each is the central design decision for KG tasks.

R-GCN: Relational Graph Convolutional Networks

7 minute read

Published:

R-GCN extends GCN to multi-relational graphs by learning a separate weight matrix for each relation type. It handles knowledge graphs with typed edges and powers both entity classification and link prediction tasks.

Graph Tasks: Node, Edge, and Graph-Level Prediction

7 minute read

Published:

GNNs can predict at three levels: properties of individual nodes, existence or type of edges, or properties of entire graphs. Each level requires a different output head and training setup.

lists

lln

local-pca

Conn-NSD: Computing the Sheaf Instead of Learning It

11 minute read

Published:

Neural Sheaf Diffusion learns the restriction maps by gradient descent. Conn-NSD computes them once, before training, by assuming the data lies on a manifold and optimally aligning neighbouring tangent spaces, matching the learned models on small graphs at roughly half the cost per epoch.

logging

logistic-regression

Logistic Regression: Linear in the Log-Odds

19 minute read

Published:

Logistic regression is not a squashed linear regression, it is a straight line drawn in log-odds space, which is why one coefficient means one multiplication of the odds, and why perfectly separable data drives that coefficient to infinity.

long-context

FoPE: Fourier Position Embedding for Length Generalization

5 minute read

Published:

FoPE rethinks long-context positional encoding from a frequency-domain perspective. Instead of only stretching RoPE heuristically, it explicitly improves attention’s periodic extension so Transformers generalize more gracefully to longer sequences.

Position Interpolation: Extending RoPE with Minimal Fine-Tuning

5 minute read

Published:

Position Interpolation rescales positions before applying RoPE so a model trained on short contexts can be adapted to longer ones with surprisingly little fine-tuning. It became the reference baseline for long-context RoPE extension.

XPos: Length-Extrapolatable Rotary Embeddings

4 minute read

Published:

XPos modifies RoPE with a multiplicative decay that keeps relative rotations while stabilising magnitude at long distance. It is one of the cleanest attempts to make rotary embeddings extrapolate better.

p-RoPE: What Makes Rotary Positional Encodings Useful?

6 minute read

Published:

This paper does two things at once: it explains what RoPE is really doing inside a trained LLM, and it proposes p-RoPE, a partial rotary variant that drops the lowest frequencies to preserve stronger semantic channels.

GAPE: Remember to Forget, Gated Adaptive Positional Encoding

9 minute read

Published:

GAPE is a drop-in RoPE augmentation that adds content-aware attention logit biases: a query-gate suppresses irrelevant distant context while a key-gate preserves salient distant tokens. Provably sharper attention and improved long-context robustness, no architecture changes needed.

long-range

Cooperative Sheaf Neural Networks: Listening Without Speaking

14 minute read

Published:

A sheaf gives every node a matrix-valued say in how its neighbours reach it, but not in whether they do. Set a node’s restriction maps to zero to stop it listening and you also stop it speaking. Fixing that needs sheaves on directed graphs, and the fix costs the Laplacian its positive semi-definiteness.

low-rank

Eigenvectors, the Spectral Theorem, and Why the SVD Always Exists

7 minute read

Published:

Eigenvectors are the directions a matrix does not rotate, when they exist. The SVD asks a weaker question that always has an answer, and that is exactly why it, not the eigendecomposition, is the workhorse of applied linear algebra.

lower-bounds

lstm

RNNs, LSTMs, and GRUs: Sequence Models Before Attention

6 minute read

Published:

A recurrent network shares weights across time exactly as a convolution shares them across space. The trouble is that gradients then travel through a product of Jacobians, and a product of a hundred numbers slightly below one is zero.

machine-learning

Machine Learning Before Transformers: A Working Foundation

4 minute read

Published:

Every later book on this site assumes you already know what a loss is, why gradient descent works, and what a convolution buys you. This book supplies that, and follows one thread through it: how much structure you build in versus how much you let the data decide.

manifold-hypothesis

manifolds

Geometry for Machine Learning: Why Shape Keeps Coming Back

5 minute read

Published:

Every embedding you have ever trained lives in a metric space, every dataset you have ever fitted sits near a surface far thinner than its ambient dimension, and every architecture you trust encodes a symmetry. Geometry is not decoration on top of ML, it is what makes the problems tractable.

Geodesics: Learning on Curved Domains

6 minute read

Published:

On a surface there is no global grid to slide a filter along, and no canonical direction to call ‘up’. What survives is distance, and building convolution out of distance alone exposes exactly one ambiguity, which is where the next chapter starts.

manipulation

GNNs for Robotics: Planning, Manipulation, and Multi-Agent Systems

8 minute read

Published:

Robots interact with structured environments: objects have relationships, joints form kinematic chains, agents communicate through interaction graphs. GNNs encode these relational structures, enabling generalisation across object configurations, robot morphologies, and multi-agent scenarios.

map

margin

Support Vector Machines: Margins and the Kernel Trick

8 minute read

Published:

Among all the hyperplanes that separate two classes, one sits furthest from both. Finding it turns out to depend on the data only through inner products, and that single fact is what lets you work in a space you never build.

masking

master-theorem

match

matrix-calculus

maximum-likelihood

mcmc

Hamiltonian Dynamics: Phase Space, Liouville, and Why HMC Works

6 minute read

Published:

Hamiltonian Monte Carlo is not a heuristic that happens to move well. It is exact because Hamiltonian flow preserves phase-space volume and is reversible, which is what makes the Metropolis acceptance ratio collapse to a difference of energies.

measure

mechanics

Hamiltonian Dynamics: Phase Space, Liouville, and Why HMC Works

6 minute read

Published:

Hamiltonian Monte Carlo is not a heuristic that happens to move well. It is exact because Hamiltonian flow preserves phase-space volume and is reversible, which is what makes the Metropolis acceptance ratio collapse to a difference of energies.

Lagrangian Mechanics: Why Nature Optimises a Functional

6 minute read

Published:

Newton says a particle moves because a force pushes it. Lagrange says it moves along the path that makes the action stationary. The second statement is harder to believe and far easier to use, and it is the one machine learning inherited.

mechanism

Self-Attention: Teaching Machines to Focus

5 minute read

Published:

Self-attention is the core of every Transformer. Learn how Query, Key, and Value vectors let every token directly attend to every other, and why that matters.

memoisation

Recursion and Dynamic Programming: Two Conditions, One Filled Table

7 minute read

Published:

Dynamic programming is not a trick, it is a diagnosis: if a problem has optimal substructure and overlapping subproblems, exhaustive recursion is doing the same work exponentially often and a table fixes it. Here is the diagnosis, and edit distance worked out cell by cell.

memory

Temporal Graph Networks: Learning from Events

8 minute read

Published:

TGN (Temporal Graph Network) is the leading framework for continuous-time dynamic graphs. It maintains a per-node memory that is updated upon each interaction, enabling efficient inductive link prediction on event streams.

meshes

Geodesics: Learning on Curved Domains

6 minute read

Published:

On a surface there is no global grid to slide a filter along, and no canonical direction to call ‘up’. What survives is distance, and building convolution out of distance alone exposes exactly one ambiguity, which is where the next chapter starts.

message-passing

Permutation Symmetry and the Message-Passing Blueprint

7 minute read

Published:

A graph’s nodes have no canonical order, so any model that reads one must give the same answer under relabelling. That single requirement forces the three-step message, aggregate, update template, it is not a design choice.

Message Passing on Simplicial Complexes

20 minute read

Published:

A simplex has four kinds of neighbour rather than one, and separating them lets a network see the difference between a filled triangle and an empty one, a distinction no graph neural network can make.

Why Message Passing Is Not Enough: The Case for Sheaves

7 minute read

Published:

Standard message passing aggregates neighbour features and averages. On heterophilic graphs (where neighbours often disagree), this is harmful. Cellular sheaves provide a mathematically principled framework to model per-edge relationships between node features, going beyond mere averaging.

MPNN: The General Message Passing Neural Network Framework

6 minute read

Published:

The MPNN framework (Gilmer et al., 2017) unifies GCN, GAT, GIN, GraphSAGE, and almost all spatial GNNs under one abstraction: message functions, aggregation, and update. Understanding MPNN means understanding the whole GNN family.

Message Passing: The Universal GNN Framework

4 minute read

Published:

Every GNN, GCN, GAT, GraphSAGE, GIN, is a special case of message passing. Learn the three-step loop that defines them all: compute messages, aggregate, update.

meta-path

HAN: Heterogeneous Graph Attention Networks

6 minute read

Published:

HAN combines meta-path decomposition with two levels of attention: node-level attention weights neighbours along a meta-path, and semantic-level attention weights different meta-paths. This lets the model learn which relationships matter most for a given task.

Heterogeneous Graphs: When Nodes and Edges Have Types

5 minute read

Published:

Most real-world graphs are heterogeneous, they contain multiple node types (users, items, tags) and edge types (clicks, rates, authors). Standard GNNs treat all nodes and edges identically, making them blind to this type structure.

mish

modules

Modules, Packages, and How Python Actually Finds Your Code

7 minute read

Published:

An import is not a textual include, it executes a file once, caches the result, and binds a name. Almost every confusing import error, from circular imports to ‘attempted relative import with no known parent package’, follows directly from that one sentence.

molecular

Molecular GNNs: Learning on Atoms and Bonds

9 minute read

Published:

Molecules are graphs. Molecular GNNs predict chemical properties from structure. The best models use 3D coordinates and bond angles, not just connectivity.

EGNN: E(n)-Equivariant Graph Neural Networks

9 minute read

Published:

EGNN achieves E(n)-equivariance with a simple update rule: positions updated via weighted sums of relative position vectors, features updated via invariant distances. No spherical harmonics needed.

Why Geometry Matters in Graph Neural Networks

7 minute read

Published:

Many real-world graphs are embedded in 3D space, molecules, proteins, point clouds, crystal structures. Standard GNNs ignore coordinates and only use connectivity. Geometric GNNs incorporate spatial positions and must respect physical symmetries.

Graphormer: Transformers with Structural Biases for Graphs

9 minute read

Published:

Graphormer encodes graph structure directly into Transformer attention via three biases: node centrality, spatial encoding (shortest paths), and edge encoding. It won the OGB-LSC 2021 competition on molecular property prediction.

molecular-property

GNNs for Molecules: Drug Discovery and Material Design

7 minute read

Published:

Graph neural networks are transforming computational drug discovery. Molecules are natural graphs, and GNNs learn molecular representations that predict toxicity, solubility, binding affinity, and synthesis feasibility, tasks that previously required expensive laboratory experiments.

molecules

GNNs for Molecules: Drug Discovery and Material Design

7 minute read

Published:

Graph neural networks are transforming computational drug discovery. Molecules are natural graphs, and GNNs learn molecular representations that predict toxicity, solubility, binding affinity, and synthesis feasibility, tasks that previously required expensive laboratory experiments.

mpnn

Message Passing: The Universal GNN Framework

4 minute read

Published:

Every GNN, GCN, GAT, GraphSAGE, GIN, is a special case of message passing. Learn the three-step loop that defines them all: compute messages, aggregate, update.

multi-agent

GNNs for Robotics: Planning, Manipulation, and Multi-Agent Systems

8 minute read

Published:

Robots interact with structured environments: objects have relationships, joints form kinematic chains, agents communicate through interaction graphs. GNNs encode these relational structures, enabling generalisation across object configurations, robot morphologies, and multi-agent scenarios.

multi-head

Multi-Head Attention: Many Eyes on the Data

4 minute read

Published:

One attention head sees one relationship. Multiple heads running in parallel let the model capture syntax, semantics, and coreference simultaneously, here’s how.

multigraph

multimodal

multiple-comparisons

Hypothesis Testing: What a p-Value Actually Measures

7 minute read

Published:

A p-value answers one narrow question: if nothing were going on, how often would data look at least this extreme? It says nothing about whether the effect is real, large, or worth shipping, and running twenty of them changes the meaning of all twenty.

mutual-information

neural-ODE

Graph Neural ODEs: Continuous-Time Graph Dynamics

9 minute read

Published:

Neural ODEs replace discrete layer-by-layer computation with continuous dynamics governed by a differential equation. Graph Neural ODEs apply this to graph data, treating node embeddings as a dynamical system evolving in continuous time.

neural-network

Graph Neural Networks: Learning on Graphs

5 minute read

Published:

Graphs are everywhere, molecules, social networks, road maps, knowledge bases. Graph Neural Networks learn from this relational structure by propagating information between connected nodes. Here’s the complete picture.

neural-networks

Activation Functions in Neural Networks: Why Non-Linearity Matters

7 minute read

Published:

Activation functions are the reason neural networks can model curved decision boundaries instead of collapsing into one giant linear map. This chapter builds the intuition first, then walks through the classical functions that shaped deep learning.

neural-ode

BrainDyn: Sheaves Meet Neural ODEs for Brain Dynamics

11 minute read

Published:

Brain regions do not encode information in a shared feature space, which is exactly the assumption scalar message passing makes. BrainDyn puts learnable restriction maps between regions and integrates the result as a continuous-time system, the first pairing of cellular sheaves with neural ODEs.

neural-sheaf-diffusion

Neural Sheaf Diffusion: Learning Sheaves End-to-End

10 minute read

Published:

Neural Sheaf Diffusion (Bodnar et al., 2022) learns the sheaf restriction maps from data using a neural network, then performs diffusion with the learned Sheaf Laplacian. This gives a principled, topology-grounded GNN that handles heterophily without heuristic fixes.

neuroscience

BrainDyn: Sheaves Meet Neural ODEs for Brain Dynamics

11 minute read

Published:

Brain regions do not encode information in a shared feature space, which is exactly the assumption scalar message passing makes. BrainDyn puts learnable restriction maps between regions and integrates the result as a continuous-time system, the first pairing of cellular sheaves with neural ODEs.

nlp

Transformers: The Architecture That Changed AI

7 minute read

Published:

A self-contained guide to the Transformer, the engine behind GPT, BERT, and modern AI. Learn how attention replaces recurrence and why every major AI system uses it.

node-classification

Sheaf Neural Networks and Heterophily

9 minute read

Published:

Sheaf GNNs are the principled solution to heterophily: by learning per-edge maps that transform features before comparison, they can perform diffusion that converges within classes and diverges across classes, the exact opposite of standard GCN’s collapse.

HAN: Heterogeneous Graph Attention Networks

6 minute read

Published:

HAN combines meta-path decomposition with two levels of attention: node-level attention weights neighbours along a meta-path, and semantic-level attention weights different meta-paths. This lets the model learn which relationships matter most for a given task.

Graph Tasks: Node, Edge, and Graph-Level Prediction

7 minute read

Published:

GNNs can predict at three levels: properties of individual nodes, existence or type of edges, or properties of entire graphs. Each level requires a different output head and training setup.

node-selection

TopKPool and SAGPool: Sparse Graph Pooling

8 minute read

Published:

Instead of soft cluster assignment (DiffPool), TopKPool and SAGPool select a subset of the most important nodes, producing a smaller but sparser graph at each level. Hard selection is scalable but requires careful score learning.

nodes

noether

Noether’s Theorem: Symmetry, Conservation, and Equivariant Networks

6 minute read

Published:

Energy is conserved because the laws of physics do not care what time it is. That single sentence is Noether’s theorem, and its machine learning descendant is the reason an equivariant network needs less data than one that must learn the symmetry from examples.

noise-schedule

The Forward Process: A Corruption Engineered to Be Jumped Into

6 minute read

Published:

The forward process looks like the trivial half of diffusion, but every term in it is load-bearing. Drop the shrink factor and the variance diverges; pick the wrong schedule and a third of your timesteps are spent denoising static.

norms

Norms, Inner Products, and the Geometry Behind L1 Sparsity

7 minute read

Published:

L1 regularisation produces exact zeros and L2 does not. The reason is not statistical, it is geometric: the L1 unit ball has corners on the axes, and corners are what optimisation solutions stick to.

null-space

Matrices as Linear Maps: Span, Rank, and the Subspaces They Create

7 minute read

Published:

A matrix is not a grid of numbers, it is a map. Once you read it that way, rank, column space, null space and rank–nullity stop being definitions to memorise and become one geometric statement about what the map keeps and what it destroys.

numpy

object-detection

GNNs for Computer Vision: Scene Graphs and Beyond

8 minute read

Published:

Computer vision tasks increasingly require relational reasoning, understanding how objects relate to each other, not just what they are. Scene graph generation, visual question answering, action recognition from skeletons, and 3D point cloud processing all benefit from GNN-based relational modelling.

ode-solvers

odes

Flow Matching: Training a Velocity Field Without Ever Solving an ODE

7 minute read

Published:

Continuous normalising flows were elegant and nearly untrainable, every gradient step needed an ODE solve and a divergence estimate. Flow matching removes both by regressing a velocity field against a target you can write down in closed form, one example at a time.

oop

Classes and Objects: self, Attributes, and When Inheritance Is the Wrong Tool

6 minute read

Published:

A Python class is a factory for namespaces, not a sealed blueprint. Once you see where an attribute actually lives, on the instance or on the class, the mutable-default trap, the point of self, and the reason composition usually beats inheritance all fall out of the same rule.

operator-overloading

Dunder Methods: How Python’s Protocols Replace Interfaces

6 minute read

Published:

Python has almost no interfaces to implement and no operators to declare. Instead, every piece of syntax, len(x), x[i], for y in x, a + b, with r as f, is a documented call to a method with a double-underscore name. Learn the mapping and your own types stop being second-class citizens.

operators

opinion-dynamics

Joint Diffusion and Rotation Invariance: Sheaves That Learn to Lie

12 minute read

Published:

Every sheaf network so far predicts restriction maps with an MLP on concatenated features, a universal approximator with no inductive bias for heterophily at all. Two alternatives drawn from opinion dynamics get the bias for free, and stop the parameter count scaling with the feature dimension.

optimisation

What Mathematics an ML Engineer Actually Needs

5 minute read

Published:

Almost every mathematical question asked in an ML interview reduces to two things: what a matrix does to space, and how to differentiate a composition. This book covers those two things properly and is honest about what you can safely forget.

Gradient Descent and Backpropagation: How a Model Learns

27 minute read

Published:

Training is one loop: measure the loss, ask backpropagation which way is downhill, take a small step. This chapter derives exactly how small that step has to be, why the answer is 2/a for a quadratic, and why reverse-mode differentiation gets you every gradient for roughly the price of one forward pass.

orthogonal

Diagonal, Orthogonal, and General Sheaf Maps

8 minute read

Published:

The restriction maps in a cellular sheaf can be constrained to different matrix classes: scalars, diagonal matrices, orthogonal matrices, or general matrices. Each class offers a different trade-off between expressivity and computational cost.

orthogonal-maps

Sheaf Attention Networks: GAT with Matrices Instead of Scalars

9 minute read

Published:

GAT weights a neighbour by a scalar. SheafAN keeps the scalar and adds a learned orthogonal transport matrix alongside it, recovering GAT exactly at d = 1, and turning a model that goes numerically unstable past eight layers into one that runs to sixty-four.

over-smoothing

APPNP: Personalized PageRank Meets Graph Neural Networks

7 minute read

Published:

APPNP decouples feature transformation from propagation. A neural network transforms features first; then Personalized PageRank propagates the result. This enables deep propagation without over-smoothing.

overfitting

oversmoothing

Sheaf4Rec: What a Recommender Gains from a Vector Space per Node

13 minute read

Published:

Collaborative filtering represents every user and item as one static vector. Sheaf4Rec replaces each with a vector space, and reports consistent gains on ranking metrics, though the wins come from recall rather than precision, and the headline efficiency claim is hard to reconcile with the timing table.

Sheaf Hypergraph Networks: Apparent Consensus in Higher-Order Relations

13 minute read

Published:

A graph edge relates two things. A hyperedge relates any number of them, and hypergraph networks aggregate over it uniformly, every member contributes the same way. Attaching a sheaf gives each member its own linear map into the group, and turns forced consensus into apparent consensus.

DNSD: Making Sheaf Diffusion Work at Depth

12 minute read

Published:

Neural Sheaf Diffusion has a theoretical guarantee against representation collapse that does not survive contact with depth. DNSD diagnoses why, the Laplacian’s disagreement signal vanishes as diffusion succeeds, and replaces the operator rather than patching around it.

Sheaf Neural Networks and Heterophily

9 minute read

Published:

Sheaf GNNs are the principled solution to heterophily: by learning per-edge maps that transform features before comparison, they can perform diffusion that converges within classes and diverges across classes, the exact opposite of standard GCN’s collapse.

Depth in GNNs: Why Deeper Is Not Always Better

8 minute read

Published:

In Transformers, depth = expressiveness. In GNNs, depth = both expressiveness AND over-smoothing. The optimal GNN depth is rarely more than 3-4 layers, fundamentally different from the hundreds of layers in modern LLMs.

Over-smoothing vs Over-squashing: The Difference

8 minute read

Published:

Oversmoothing and oversquashing are both problems with deep GNNs, but they affect different nodes, have different causes, and require different fixes. Confusing them leads to applying the wrong solution.

Oversmoothing: When All Node Embeddings Become the Same

9 minute read

Published:

Stack enough GNN layers and all node embeddings converge to the same vector, making the model useless. Oversmoothing is not a training problem; it is a mathematical inevitability of iterated averaging.

oversquashing

Cooperative Sheaf Neural Networks: Listening Without Speaking

14 minute read

Published:

A sheaf gives every node a matrix-valued say in how its neighbours reach it, but not in whether they do. Set a node’s restriction maps to zero to stop it listening and you also stop it speaking. Fixing that needs sheaves on directed graphs, and the fix costs the Laplacian its positive semi-definiteness.

Over-smoothing vs Over-squashing: The Difference

8 minute read

Published:

Oversmoothing and oversquashing are both problems with deep GNNs, but they affect different nodes, have different causes, and require different fixes. Confusing them leads to applying the wrong solution.

overview

Physics for Machine Learning: Why the Same Equations Keep Coming Back

5 minute read

Published:

Diffusion models, energy-based models and Hamiltonian Monte Carlo were not inspired by physics, they are physics, rewritten with a neural network in place of an analytic potential. Knowing which physics saves you from re-deriving it badly.

Geometry for Machine Learning: Why Shape Keeps Coming Back

5 minute read

Published:

Every embedding you have ever trained lives in a metric space, every dataset you have ever fitted sits near a surface far thinner than its ambient dimension, and every architecture you trust encodes a symmetry. Geometry is not decoration on top of ML, it is what makes the problems tractable.

Probability for ML Interviews: The Eight Ideas Worth Re-deriving

5 minute read

Published:

Almost every loss function in machine learning is a negative log-likelihood in disguise, and almost every model output is a distribution. This book rebuilds the probability you need to read those objects fluently, and flags the eight places interviewers know people slip.

Statistics Basics: Reasoning Backwards From Data to Model

5 minute read

Published:

Probability runs forwards: pick a model, predict the data. Statistics runs backwards, and backwards is harder, many models could have produced what you saw. Everything else in this book is machinery for handling that ambiguity honestly.

Geometric Deep Learning: One Blueprint Behind Every Architecture

6 minute read

Published:

CNNs, GNNs, Transformers and sheaf models look like separate inventions. They are the same recipe applied to different domains: identify the symmetry of your data, then build layers that respect it. This book is that recipe, and the arguments that follow from it.

Diffusion Models: Learning to Undo Noise

4 minute read

Published:

Destroying an image is easy and needs no learning at all. Diffusion models exploit that asymmetry: they define a trivial forward corruption, then train a network to walk it backwards one small step at a time.

Positional Encodings: Why Position Matters

3 minute read

Published:

Transformers see all tokens at once, which means without help they’d treat ‘cat ate mouse’ and ‘mouse ate cat’ the same. Positional encodings fix this. Here’s the full landscape.

Machine Learning Before Transformers: A Working Foundation

4 minute read

Published:

Every later book on this site assumes you already know what a loss is, why gradient descent works, and what a convolution buys you. This book supplies that, and follows one thread through it: how much structure you build in versus how much you let the data decide.

Sheaf Neural Networks: A Complete Research Guide

9 minute read

Published:

Standard GNNs assume neighbouring nodes should agree. Sheaf Neural Networks replace that assumption with a learned linear map on every edge, which turns heterophily, oversmoothing, and directional structure into one operator: the sheaf Laplacian.

Graph Neural Networks: Learning on Graphs

5 minute read

Published:

Graphs are everywhere, molecules, social networks, road maps, knowledge bases. Graph Neural Networks learn from this relational structure by propagating information between connected nodes. Here’s the complete picture.

p-RoPE

p-RoPE: What Makes Rotary Positional Encodings Useful?

6 minute read

Published:

This paper does two things at once: it explains what RoPE is really doing inside a trained LLM, and it proposes p-RoPE, a partial rotary variant that drops the lowest frequencies to preserve stronger semantic channels.

p-values

Hypothesis Testing: What a p-Value Actually Measures

7 minute read

Published:

A p-value answers one narrow question: if nothing were going on, how often would data look at least this extreme? It says nothing about whether the effect is real, large, or worth shipping, and running twenty of them changes the meaning of all twenty.

packages

Modules, Packages, and How Python Actually Finds Your Code

7 minute read

Published:

An import is not a textual include, it executes a file once, caches the result, and binds a name. Almost every confusing import error, from circular imports to ‘attempted relative import with no known parent package’, follows directly from that one sentence.

padding

parallel-transport

Conn-NSD: Computing the Sheaf Instead of Learning It

11 minute read

Published:

Neural Sheaf Diffusion learns the restriction maps by gradient descent. Conn-NSD computes them once, before training, by assuming the data lies on a manifold and optimally aligning neighbouring tangent spaces, matching the learned models on small graphs at roughly half the cost per epoch.

Gauges: When There Is No Shared Frame

7 minute read

Published:

The previous chapter ended on an arbitrary choice that could not be eliminated. Gauge theory’s answer is to stop trying: keep every local frame, transport between them explicitly, and require the model to be indifferent to which frames you picked.

parameter-efficiency

Joint Diffusion and Rotation Invariance: Sheaves That Learn to Lie

12 minute read

Published:

Every sheaf network so far predicts restriction maps with an MLP on concatenated features, a universal approximator with no inductive bias for heterophily at all. Two alternatives drawn from opinion dynamics get the bias for free, and stop the parameter count scaling with the feature dimension.

pathlib

Files and Context Managers: Why with Is Not Optional

7 minute read

Published:

A file object that falls out of scope without with does get closed eventually, but ‘eventually’ means whenever the garbage collector gets around to it, which is not a promise any program handling more than a handful of files can live with.

pca

PCA: Maximum Variance and Minimum Reconstruction Error

6 minute read

Published:

PCA can be derived by asking for the directions of greatest spread, or by asking for the subspace that loses the least when you project onto it. The two questions look unrelated and have the same answer, which is the most useful thing to understand about it.

pde-gnn

Surfing on the Neural Sheaf: What Happens If You Use the Wave Equation

9 minute read

Published:

Every sheaf model so far discretises the heat equation, which dissipates energy. Suk et al. try the wave equation instead, which conserves it, a one-line change of PDE with a clean theoretical motivation and a genuinely mixed empirical result.

pdf

Random Variables: A Density Is Not a Probability

5 minute read

Published:

A probability density can be 2, or 200, and nothing is wrong. Getting clear on what a PDF actually is fixes half the confusion about continuous distributions, and explains the Jacobian term that makes normalising flows work.

performance

permutation-equivariance

Permutation Symmetry and the Message-Passing Blueprint

7 minute read

Published:

A graph’s nodes have no canonical order, so any model that reads one must give the same answer under relabelling. That single requirement forces the three-step message, aggregate, update template, it is not a design choice.

permutation-test

The Bootstrap: Uncertainty When the Algebra Runs Out

6 minute read

Published:

If you cannot resample from the population, resample from your sample instead. That one substitution gives standard errors and intervals for statistics whose sampling distributions nobody can write down, and it fails in ways worth memorising.

persistent-homology

physics

Lagrangian Mechanics: Why Nature Optimises a Functional

6 minute read

Published:

Newton says a particle moves because a force pushes it. Lagrange says it moves along the path that makes the action stationary. The second statement is harder to believe and far easier to use, and it is the one machine learning inherited.

Physics for Machine Learning: Why the Same Equations Keep Coming Back

5 minute read

Published:

Diffusion models, energy-based models and Hamiltonian Monte Carlo were not inspired by physics, they are physics, rewritten with a neural network in place of an analytic potential. Knowing which physics saves you from re-deriving it badly.

pip

planning

GNNs for Robotics: Planning, Manipulation, and Multi-Agent Systems

8 minute read

Published:

Robots interact with structured environments: objects have relationships, joints form kinematic chains, agents communicate through interaction graphs. GNNs encode these relational structures, enabling generalisation across object configurations, robot morphologies, and multi-agent scenarios.

point-cloud

GNNs for Computer Vision: Scene Graphs and Beyond

8 minute read

Published:

Computer vision tasks increasingly require relational reasoning, understanding how objects relate to each other, not just what they are. Scene graph generation, visual question answering, action recognition from skeletons, and 3D point cloud processing all benefit from GNN-based relational modelling.

poisson

polynomial-filter

Polynomial Neural Sheaf Diffusion

8 minute read

Published:

Polynomial Neural Sheaf Diffusion (PNSD) replaces the fixed diffusion operator (I - Δ_F) with a learnable polynomial of the Sheaf Laplacian. This gives the model spectral flexibility, it can learn to amplify or suppress different frequency components of the sheaf signal.

polynomial-filters

PolyNSD: Polynomial Neural Sheaf Diffusion

10 minute read

Published:

PolyNSD replaces the NSD propagation operator with a degree-K Chebyshev polynomial in the normalised sheaf Laplacian, achieving SOTA on homo- and heterophilic benchmarks with only diagonal restriction maps and dramatically lower memory usage.

polynomial-sheaf-diffusion

Polynomial Neural Sheaf Diffusion

8 minute read

Published:

Polynomial Neural Sheaf Diffusion (PNSD) replaces the fixed diffusion operator (I - Δ_F) with a learnable polynomial of the Sheaf Laplacian. This gives the model spectral flexibility, it can learn to amplify or suppress different frequency components of the sheaf signal.

pooling

SheafPool: Basis-Invariant Graph Readout for Sheaf Neural Networks

8 minute read

Published:

SheafPool solves a key missing piece in sheaf GNNs: graph-level pooling. Instead of averaging stalk vectors in arbitrary local bases, it aligns them into a shared canonical frame and builds a readout that is invariant to local basis changes.

Convolutions and CNNs: Weight Sharing as a Prior

22 minute read

Published:

A dense layer from a 224-by-224 colour image to 1000 units holds 150.5 million weights; a 3-by-3, 64-filter convolution holds 1,792, and the two constraints that buy that factor of 84,000 are exactly the prior that makes it work on images.

Global Pooling in GNNs: Mean, Sum, and Max

6 minute read

Published:

To predict a property of an entire graph, node embeddings must be aggregated into a single vector. The choice of global pooling, mean, sum, or max, is not arbitrary: each has distinct expressive power and fits different tasks.

position

Structural vs Positional Encodings in Graphs

7 minute read

Published:

Positional encodings say where a node is in the graph. Structural encodings say what role it plays. They are complementary, and confusing them leads to poor design choices.

position-interpolation

Position Interpolation: Extending RoPE with Minimal Fine-Tuning

5 minute read

Published:

Position Interpolation rescales positions before applying RoPE so a model trained on short contexts can be adapted to longer ones with surprisingly little fine-tuning. It became the reference baseline for long-context RoPE extension.

positional-encoding

FoPE: Fourier Position Embedding for Length Generalization

5 minute read

Published:

FoPE rethinks long-context positional encoding from a frequency-domain perspective. Instead of only stretching RoPE heuristically, it explicitly improves attention’s periodic extension so Transformers generalize more gracefully to longer sequences.

Position Interpolation: Extending RoPE with Minimal Fine-Tuning

5 minute read

Published:

Position Interpolation rescales positions before applying RoPE so a model trained on short contexts can be adapted to longer ones with surprisingly little fine-tuning. It became the reference baseline for long-context RoPE extension.

XPos: Length-Extrapolatable Rotary Embeddings

4 minute read

Published:

XPos modifies RoPE with a multiplicative decay that keeps relative rotations while stabilising magnitude at long distance. It is one of the cleanest attempts to make rotary embeddings extrapolate better.

p-RoPE: What Makes Rotary Positional Encodings Useful?

6 minute read

Published:

This paper does two things at once: it explains what RoPE is really doing inside a trained LLM, and it proposes p-RoPE, a partial rotary variant that drops the lowest frequencies to preserve stronger semantic channels.

GAPE: Remember to Forget, Gated Adaptive Positional Encoding

9 minute read

Published:

GAPE is a drop-in RoPE augmentation that adds content-aware attention logit biases: a query-gate suppresses irrelevant distant context while a key-gate preserves salient distant tokens. Provably sharper attention and improved long-context robustness, no architecture changes needed.

LongRoPE: Extending Context to 2 Million Tokens

7 minute read

Published:

LongRoPE (Microsoft, 2024) pushes RoPE-based context to 2M tokens by searching for optimal per-dimension rescaling factors, far outperforming NTK or YaRN at extreme lengths.

YaRN: Yet Another RoPE Extensionn Method

6 minute read

Published:

YaRN combines NTK scaling for high-frequency dimensions with linear interpolation for low-frequency ones, plus a temperature correction, achieving better long-context performance with minimal fine-tuning.

ALiBi: Attention with Linear Biases

4 minute read

Published:

ALiBi skips traditional positional embeddings entirely and just subtracts a distance penalty from attention scores. Zero extra parameters, excellent extrapolation. Press et al., 2022.

RoPE: Rotary Position Embeddings

4 minute read

Published:

RoPE encodes position by rotating query and key vectors by an angle proportional to position. The clever result: absolute encoding produces relative attention for free, and it’s now the dominant PE for large language models.

Relative Positional Encodings: It’s All About Distance

4 minute read

Published:

Instead of asking ‘where am I?’, relative PEs ask ‘how far are these two tokens apart?’ Shaw et al. and T5 both use this idea to build models that generalise better to variable-length inputs.

Learned Positional Encodings: Data-Driven Position

3 minute read

Published:

Instead of a fixed formula, why not just train position embeddings from scratch, like word embeddings? That’s exactly what BERT and GPT-1 do. Here’s how and when it works.

Sinusoidal Positional Encodings: The Original Solution

3 minute read

Published:

The PE method from the 2017 ‘Attention Is All You Need’ paper uses sine and cosine waves at different frequencies. Learn why this elegant choice encodes position without any training.

Positional Encodings: Why Position Matters

3 minute read

Published:

Transformers see all tokens at once, which means without help they’d treat ‘cat ate mouse’ and ‘mouse ate cat’ the same. Positional encodings fix this. Here’s the full landscape.

Structural vs Positional Encodings in Graphs

7 minute read

Published:

Positional encodings say where a node is in the graph. Structural encodings say what role it plays. They are complementary, and confusing them leads to poor design choices.

Random Walk Positional Encodings

7 minute read

Published:

Random walk positional encodings encode each node’s structural context by computing the probability of returning to it from itself in k steps, a computationally efficient alternative to Laplacian eigenvectors with no sign ambiguity.

Laplacian Eigenvectors as Graph Positional Encodings

11 minute read

Published:

The k smallest eigenvectors of the graph Laplacian form a natural positional embedding space, the graph’s own coordinate system. They capture global structure, symmetry, and community membership.

Why GNNs Need Positional Encodings

7 minute read

Published:

Message-passing GNNs are permutation-equivariant by design, they cannot assign unique positions to nodes. Without positional encodings, symmetric nodes are indistinguishable. Here is why that matters and how to fix it.

Graph Transformers: Bringing Attention to Graphs

6 minute read

Published:

Graph Transformers replace or augment local message passing with full pairwise attention, every node attends to every other node. This solves long-range dependencies and over-squashing at the cost of O(N²) computation.

positional-encodings

Sheaf-Based Positional Encodings: Letting Node Features Into the Spectrum

12 minute read

Published:

Laplacian eigenvector positional encodings tell a node where it sits in the graph, but the graph Laplacian only knows adjacency, so two structurally identical nodes get identical encodings no matter how different their features are. Swap in the sheaf Laplacian and the features enter the spectrum.

posterior

priority-queue

probability

Probability for ML Interviews: The Eight Ideas Worth Re-deriving

5 minute read

Published:

Almost every loss function in machine learning is a negative log-likelihood in disguise, and almost every model output is a distribution. This book rebuilds the probability you need to read those objects fluently, and flags the eight places interviewers know people slip.

probability-flow-ode

Score Matching and the SDE View: DDPM as One Discretisation Among Many

5 minute read

Published:

Noise prediction and score estimation are the same network in different units. Taking the step size to zero turns the whole method into a stochastic differential equation, and reveals a deterministic ODE with identical marginals hiding inside it.

probability-paths

Diffusion vs Flow Matching: Two Names for One Family

5 minute read

Published:

Flow matching is often presented as the successor to diffusion. It is more accurate, and more useful, to say that diffusion is one particular probability path inside the flow-matching framework, and not the straightest one available.

processes

profiling

projections

Euclidean Space: Inner Products, Projections and the Margin

6 minute read

Published:

One bilinear form generates the whole of flat geometry: lengths, angles, orthogonality, projections and the distance from a point to a hyperplane. Get the projection formula and you get the SVM margin for free.

propagation

APPNP: Personalized PageRank Meets Graph Neural Networks

7 minute read

Published:

APPNP decouples feature transformation from propagation. A neural network transforms features first; then Personalized PageRank propagates the result. This enables deep propagation without over-smoothing.

protocols

Dunder Methods: How Python’s Protocols Replace Interfaces

6 minute read

Published:

Python has almost no interfaces to implement and no operators to declare. Instead, every piece of syntax, len(x), x[i], for y in x, a + b, with r as f, is a documented call to a method with a double-underscore name. Learn the mapping and your own types stop being second-class citizens.

python

Dicts and Sets: Hashing, Defaults, and What Makes a Key Legal

7 minute read

Published:

A dict trades memory for the ability to skip the search entirely. Everything that follows, why keys must be hashable, why lists cannot be keys, and why 1, 1.0 and True collide, comes from that single trade.

Names, Not Boxes: Python Syntax, Variables and the Built-in Types

7 minute read

Published:

A Python variable is not a container that holds a value, it is a label stuck onto an object that lives somewhere else. Almost every early surprise, from shared lists to 0.1 + 0.2, follows from taking that sentence literally.

python-internals

quantiles

queues

quicksort

radial-tangential-transport

Equivariant Sheaf Neural Networks: Learning Geometric Transport on Graphs

33 minute read

Published:

Sheaf networks move features through matrix-valued maps but ignore the symmetries of physical space; equivariant GNNs respect those symmetries but move vectors with scalars. ESNN does both, learned, directed, matrix-valued transport that is exactly E(n)-equivariant, and proves that when displacement is the only geometric input, the radial–tangential family is all the linear transport there is.

random-forest

Trees, Forests, and Boosting: Axis-Aligned Everything

15 minute read

Published:

A decision tree chops feature space into axis-aligned boxes and predicts one number per box, which explains why it needs no feature scaling, why it approximates a diagonal boundary as a staircase, and why it cannot extrapolate a single step beyond the training range.

random-variables

Random Variables: A Density Is Not a Probability

5 minute read

Published:

A probability density can be 2, or 200, and nothing is wrong. Getting clear on what a PDF actually is fixes half the confusion about continuous distributions, and explains the Jacobian term that makes normalising flows work.

random-walk

Random Walk Positional Encodings

7 minute read

Published:

Random walk positional encodings encode each node’s structural context by computing the probability of returning to it from itself in k steps, a computationally efficient alternative to Laplacian eigenvectors with no sign ambiguity.

rank

Matrices as Linear Maps: Span, Rank, and the Subspaces They Create

7 minute read

Published:

A matrix is not a grid of numbers, it is a map. Once you read it that way, rank, column space, null space and rank–nullity stop being definitions to memorise and become one geometric statement about what the map keeps and what it destroys.

rbf

Support Vector Machines: Margins and the Kernel Trick

8 minute read

Published:

Among all the hyperplanes that separate two classes, one sits furthest from both. Finding it turns out to depend on the data only through inner products, and that single fact is what lets you work in a space you never build.

readout

Graph Classification: From Node Embeddings to Graph Embeddings

7 minute read

Published:

Graph classification is the task of predicting a label for an entire graph. It requires composing message passing (node embeddings), readout (graph embedding), and a classifier, and all three choices interact to determine model expressiveness.

Set2Set and Attention Readout: Order-Invariant Graph Summaries

8 minute read

Published:

Mean and sum readout treat all nodes equally. Attention readout learns which nodes matter most for a given task. Set2Set goes further, it uses an LSTM to iteratively query the node set, producing richer graph representations than single-pass pooling.

Global Pooling in GNNs: Mean, Sum, and Max

6 minute read

Published:

To predict a property of an entire graph, node embeddings must be aggregated into a single vector. The choice of global pooling, mean, sum, or max, is not arbitrary: each has distinct expressive power and fits different tasks.

reasoning

GNNs for Knowledge Graphs: Reasoning and Completion

8 minute read

Published:

Knowledge graphs encode human knowledge as typed entity-relation triples. GNNs enable structure-aware entity representation, multi-hop reasoning, knowledge base completion, and entity alignment, tasks that shallow embedding methods cannot fully solve.

receptive-field

Convolutions and CNNs: Weight Sharing as a Prior

22 minute read

Published:

A dense layer from a 224-by-224 colour image to 1000 units holds 150.5 million weights; a 3-by-3, 64-filter convolution holds 1,792, and the two constraints that buy that factor of 84,000 are exactly the prior that makes it work on images.

Depth in GNNs: Why Deeper Is Not Always Better

8 minute read

Published:

In Transformers, depth = expressiveness. In GNNs, depth = both expressiveness AND over-smoothing. The optimal GNN depth is rarely more than 3-4 layers, fundamentally different from the hundreds of layers in modern LLMs.

recommender-systems

Sheaf4Rec: What a Recommender Gains from a Vector Space per Node

13 minute read

Published:

Collaborative filtering represents every user and item as one static vector. Sheaf4Rec replaces each with a vector space, and reports consistent gains on ranking metrics, though the wins come from recall rather than precision, and the headline efficiency claim is hard to reconcile with the timing table.

GNNs for Recommender Systems

6 minute read

Published:

Recommendation is naturally a graph problem: users and items are nodes, interactions are edges. GNNs on bipartite user-item graphs capture higher-order collaborative filtering signals, friends of friends liked this, that matrix factorisation cannot represent.

rectified-flow

Diffusion vs Flow Matching: Two Names for One Family

5 minute read

Published:

Flow matching is often presented as the successor to diffusion. It is more accurate, and more useful, to say that diffusion is one particular probability path inside the flow-matching framework, and not the straightest one available.

recursion

Recursion and Dynamic Programming: Two Conditions, One Filled Table

7 minute read

Published:

Dynamic programming is not a trick, it is a diagnosis: if a problem has optimal substructure and overlapping subproblems, exhaustive recursion is doing the same work exponentially often and a table fixes it. Here is the diagnosis, and edit distance worked out cell by cell.

reflow

regular-graphs

regularisation

Linear Regression: Least Squares as Projection

20 minute read

Published:

Fitting a line by least squares is not an optimisation trick, it is the orthogonal projection of the observation vector onto the column space of the design matrix, and once you see that, the normal equations, the failure modes, and the reason we solve by QR instead of inverting all follow from one picture.

relational

R-GCN: Relational Graph Convolutional Networks

7 minute read

Published:

R-GCN extends GCN to multi-relational graphs by learning a separate weight matrix for each relation type. It handles knowledge graphs with typed edges and powers both entity classification and link prediction tasks.

Heterogeneous Graphs: When Nodes and Edges Have Types

5 minute read

Published:

Most real-world graphs are heterogeneous, they contain multiple node types (users, items, tags) and edge types (clicks, rates, authors). Standard GNNs treat all nodes and edges identically, making them blind to this type structure.

relative

Relative Positional Encodings: It’s All About Distance

4 minute read

Published:

Instead of asking ‘where am I?’, relative PEs ask ‘how far are these two tokens apart?’ Shaw et al. and T5 both use this idea to build models that generalise better to variable-length inputs.

relu

Activation Functions in Neural Networks: Why Non-Linearity Matters

7 minute read

Published:

Activation functions are the reason neural networks can model curved decision boundaries instead of collapsing into one giant linear map. This chapter builds the intuition first, then walks through the classical functions that shaped deep learning.

resampling

The Bootstrap: Uncertainty When the Algebra Runs Out

6 minute read

Published:

If you cannot resample from the population, resample from your sample instead. That one substitution gives standard errors and intervals for statistics whose sampling distributions nobody can write down, and it fails in ways worth memorising.

residual

The Transformer Block: Putting It All Together

6 minute read

Published:

A single Transformer block combines attention, residuals, layer norm, and an FFN into one reusable unit. Understanding this block is understanding the Transformer.

Residual Connections: Why Transformers Can Be Deep

7 minute read

Published:

Without residual connections, training a 96-layer Transformer would be practically impossible. The skip connection is a simple addition that solves the vanishing gradient problem and enables arbitrary depth.

restriction-map

What Is a Sheaf? From Topology to Graph Learning

8 minute read

Published:

A sheaf is a mathematical object from algebraic topology that assigns vector spaces to cells and linear maps between them. On graphs, sheaves assign feature spaces to nodes and edges, with restriction maps encoding how node features relate across edges.

reverse-process

ridge

Estimators, Bias and Variance: Why Unbiased Is Not the Same as Good

6 minute read

Published:

An estimator is a random variable, so it has a mean and a spread. Squared error splits exactly into those two pieces, and once you see the split, it becomes obvious that deliberately biasing an estimator can make it strictly better.

Linear Regression: Least Squares as Projection

20 minute read

Published:

Fitting a line by least squares is not an optimisation trick, it is the orthogonal projection of the observation vector onto the column space of the design matrix, and once you see that, the normal equations, the failure modes, and the reason we solve by QR instead of inverting all follow from one picture.

riemannian

riemannian-geometry

Conn-NSD: Computing the Sheaf Instead of Learning It

11 minute read

Published:

Neural Sheaf Diffusion learns the restriction maps by gradient descent. Conn-NSD computes them once, before training, by assuming the data lies on a manifold and optimally aligning neighbouring tangent spaces, matching the learned models on small graphs at roughly half the cost per epoch.

rnn

RNNs, LSTMs, and GRUs: Sequence Models Before Attention

6 minute read

Published:

A recurrent network shares weights across time exactly as a convolution shares them across space. The trouble is that gradients then travel through a product of Jacobians, and a product of a hundred numbers slightly below one is zero.

road-network

GNNs for Traffic Forecasting

8 minute read

Published:

Traffic prediction is a canonical spatio-temporal graph task: sensors on roads form a fixed graph, and speed/volume measurements evolve over time. GNNs capture spatial correlations between sensors; RNNs or convolutions capture temporal patterns. Together they achieve state-of-the-art traffic forecasting.

robotics

GNNs for Robotics: Planning, Manipulation, and Multi-Agent Systems

8 minute read

Published:

Robots interact with structured environments: objects have relationships, joints form kinematic chains, agents communicate through interaction graphs. GNNs encode these relational structures, enabling generalisation across object configurations, robot morphologies, and multi-agent scenarios.

robustness

role

Structural vs Positional Encodings in Graphs

7 minute read

Published:

Positional encodings say where a node is in the graph. Structural encodings say what role it plays. They are complementary, and confusing them leads to poor design choices.

rope

GAPE: Remember to Forget, Gated Adaptive Positional Encoding

9 minute read

Published:

GAPE is a drop-in RoPE augmentation that adds content-aware attention logit biases: a query-gate suppresses irrelevant distant context while a key-gate preserves salient distant tokens. Provably sharper attention and improved long-context robustness, no architecture changes needed.

RoPE: Rotary Position Embeddings

4 minute read

Published:

RoPE encodes position by rotating query and key vectors by an angle proportional to position. The clever result: absolute encoding produces relative attention for free, and it’s now the dominant PE for large language models.

rotary

RoPE: Rotary Position Embeddings

4 minute read

Published:

RoPE encodes position by rotating query and key vectors by an angle proportional to position. The clever result: absolute encoding produces relative attention for free, and it’s now the dominant PE for large language models.

rotation

Groups: Equivariance Beyond Translation

6 minute read

Published:

Translation is one group. Swap it for rotations, reflections, or the rigid motions of 3-D space and the same construction produces a different architecture, with the parameter count cut by exactly the size of the orbit.

rotation-invariance

Joint Diffusion and Rotation Invariance: Sheaves That Learn to Lie

12 minute read

Published:

Every sheaf network so far predicts restriction maps with an MLP on concatenated features, a universal approximator with no inductive bias for heterophily at all. Two alternatives drawn from opinion dynamics get the bias for free, and stop the parameter count scaling with the feature dimension.

sagpool

TopKPool and SAGPool: Sparse Graph Pooling

8 minute read

Published:

Instead of soft cluster assignment (DiffPool), TopKPool and SAGPool select a subset of the most important nodes, producing a smaller but sparser graph at each level. Hard selection is scalable but requires careful score learning.

samplers

sampling

GraphSAGE: Inductive Learning on Large Graphs

4 minute read

Published:

GCN and GAT learn embeddings for fixed graphs, add a new node and you’re stuck. GraphSAGE (Hamilton et al., 2017) learns an aggregation function instead, so it can generate embeddings for entirely new nodes at inference time.

sampling-distribution

Confidence Intervals: The Interval Is Random, the Parameter Is Not

5 minute read

Published:

A 95% confidence interval does not say the parameter is 95% likely to be inside it. It says the recipe that produced the interval succeeds 95% of the time. That distinction is the single most-failed question in statistics interviews.

scalability

Diagonal, Orthogonal, and General Sheaf Maps

8 minute read

Published:

The restriction maps in a cellular sheaf can be constrained to different matrix classes: scalars, diagonal matrices, orthogonal matrices, or general matrices. Each class offers a different trade-off between expressivity and computational cost.

scaling

The Hardware Lottery: Why the Dense Version Won

6 minute read

Published:

Message passing on a sparse graph does asymptotically less work than attention over every pair. It is still the slower one to train. This chapter is about why the architecture that wins is the one your hardware happens to like.

scene-graph

GNNs for Computer Vision: Scene Graphs and Beyond

8 minute read

Published:

Computer vision tasks increasingly require relational reasoning, understanding how objects relate to each other, not just what they are. Scene graph generation, visual question answering, action recognition from skeletons, and 3D point cloud processing all benefit from GNN-based relational modelling.

scope

score-based-models

score-matching

Score Matching and the SDE View: DDPM as One Discretisation Among Many

5 minute read

Published:

Noise prediction and score estimation are the same network in different units. Taking the step size to zero turns the whole method into a stochastic differential equation, and reveals a deterministic ODE with identical marginals hiding inside it.

sde

Score Matching and the SDE View: DDPM as One Discretisation Among Many

5 minute read

Published:

Noise prediction and score estimation are the same network in different units. Taking the step size to zero turns the whole method into a stochastic differential equation, and reveals a deterministic ODE with identical marginals hiding inside it.

second-order-methods

Jacobians, Hessians, and Why Newton’s Method Loses at Scale

7 minute read

Published:

The Jacobian tells you how a map distorts volume, which is exactly the term normalising flows have to pay. The Hessian tells you the shape of the valley you are descending. Both are indispensable to reason with and, at a billion parameters, hopeless to form.

sequence-models

RNNs, LSTMs, and GRUs: Sequence Models Before Attention

6 minute read

Published:

A recurrent network shares weights across time exactly as a convolution shares them across space. The trouble is that gradients then travel through a product of Jacobians, and a product of a hundred numbers slightly below one is zero.

set2set

Set2Set and Attention Readout: Order-Invariant Graph Summaries

8 minute read

Published:

Mean and sum readout treat all nodes equally. Attention readout learns which nodes matter most for a given task. Set2Set goes further, it uses an LSTM to iteratively query the node set, producing richer graph representations than single-pass pooling.

sets

Dicts and Sets: Hashing, Defaults, and What Makes a Key Legal

7 minute read

Published:

A dict trades memory for the ability to skip the search entirely. Everything that follows, why keys must be hashable, why lists cannot be keys, and why 1, 1.0 and True collide, comes from that single trade.

sgd

Gradient Descent and Backpropagation: How a Model Learns

27 minute read

Published:

Training is one loop: measure the loss, ask backpropagation which way is downhill, take a small step. This chapter derives exactly how small that step has to be, why the answer is 2/a for a quadratic, and why reverse-mode differentiation gets you every gradient for roughly the price of one forward pass.

sheaf

Sheaf Neural Networks: A Complete Research Guide

9 minute read

Published:

Standard GNNs assume neighbouring nodes should agree. Sheaf Neural Networks replace that assumption with a learned linear map on every edge, which turns heterophily, oversmoothing, and directional structure into one operator: the sheaf Laplacian.

Polynomial Neural Sheaf Diffusion

8 minute read

Published:

Polynomial Neural Sheaf Diffusion (PNSD) replaces the fixed diffusion operator (I - Δ_F) with a learnable polynomial of the Sheaf Laplacian. This gives the model spectral flexibility, it can learn to amplify or suppress different frequency components of the sheaf signal.

Equivariant Sheaf Neural Networks

9 minute read

Published:

Sheaves with orthogonal restriction maps define a connection on the graph, a parallel transport structure over edges. This connects sheaf GNNs to differential geometry and enables equivariant processing of data with local coordinate frames at each node.

Sheaf Neural Networks and Heterophily

9 minute read

Published:

Sheaf GNNs are the principled solution to heterophily: by learning per-edge maps that transform features before comparison, they can perform diffusion that converges within classes and diverges across classes, the exact opposite of standard GCN’s collapse.

What Is a Sheaf? From Topology to Graph Learning

8 minute read

Published:

A sheaf is a mathematical object from algebraic topology that assigns vector spaces to cells and linear maps between them. On graphs, sheaves assign feature spaces to nodes and edges, with restriction maps encoding how node features relate across edges.

Why Message Passing Is Not Enough: The Case for Sheaves

7 minute read

Published:

Standard message passing aggregates neighbour features and averages. On heterophilic graphs (where neighbours often disagree), this is harmful. Cellular sheaves provide a mathematically principled framework to model per-edge relationships between node features, going beyond mere averaging.

sheaf-attention

Sheaf Attention Networks: GAT with Matrices Instead of Scalars

9 minute read

Published:

GAT weights a neighbour by a scalar. SheafAN keeps the scalar and adds a learned orthogonal transport matrix alongside it, recovering GAT exactly at d = 1, and turning a model that goes numerically unstable past eight layers into one that runs to sixty-four.

sheaf-cohomology

sheaf-laplacian

The Sheaf Laplacian: Spectral Theory for Sheaves

7 minute read

Published:

The Sheaf Laplacian generalises the graph Laplacian by incorporating per-edge restriction maps. Its spectrum reveals how consistent data is under the sheaf. Sheaf diffusion with this Laplacian generalises GCN to handle heterophilic graphs.

sheaf-maps

Diagonal, Orthogonal, and General Sheaf Maps

8 minute read

Published:

The restriction maps in a cellular sheaf can be constrained to different matrix classes: scalars, diagonal matrices, orthogonal matrices, or general matrices. Each class offers a different trade-off between expressivity and computational cost.

sheaf-neural-networks

Equivariant Sheaf Neural Networks: Learning Geometric Transport on Graphs

33 minute read

Published:

Sheaf networks move features through matrix-valued maps but ignore the symmetries of physical space; equivariant GNNs respect those symmetries but move vectors with scalars. ESNN does both, learned, directed, matrix-valued transport that is exactly E(n)-equivariant, and proves that when displacement is the only geometric input, the radial–tangential family is all the linear transport there is.

Sheaf4Rec: What a Recommender Gains from a Vector Space per Node

13 minute read

Published:

Collaborative filtering represents every user and item as one static vector. Sheaf4Rec replaces each with a vector space, and reports consistent gains on ranking metrics, though the wins come from recall rather than precision, and the headline efficiency claim is hard to reconcile with the timing table.

Cooperative Sheaf Neural Networks: Listening Without Speaking

14 minute read

Published:

A sheaf gives every node a matrix-valued say in how its neighbours reach it, but not in whether they do. Set a node’s restriction maps to zero to stop it listening and you also stop it speaking. Fixing that needs sheaves on directed graphs, and the fix costs the Laplacian its positive semi-definiteness.

Sheaf Hypergraph Networks: Apparent Consensus in Higher-Order Relations

13 minute read

Published:

A graph edge relates two things. A hyperedge relates any number of them, and hypergraph networks aggregate over it uniformly, every member contributes the same way. Attaching a sheaf gives each member its own linear map into the group, and turns forced consensus into apparent consensus.

Bayesian Sheaf Neural Networks: Putting a Distribution on the Geometry

13 minute read

Published:

If a sheaf neural network learns its geometry from data, it can learn the wrong geometry and have no way of knowing. Treating the sheaf Laplacian as a latent random variable fixes that, but requires a reparameterisable distribution on SO(n) with a tractable density, which did not exist.

Joint Diffusion and Rotation Invariance: Sheaves That Learn to Lie

12 minute read

Published:

Every sheaf network so far predicts restriction maps with an MLP on concatenated features, a universal approximator with no inductive bias for heterophily at all. Two alternatives drawn from opinion dynamics get the bias for free, and stop the parameter count scaling with the feature dimension.

Surfing on the Neural Sheaf: What Happens If You Use the Wave Equation

9 minute read

Published:

Every sheaf model so far discretises the heat equation, which dissipates energy. Suk et al. try the wave equation instead, which conserves it, a one-line change of PDE with a clean theoretical motivation and a genuinely mixed empirical result.

Conn-NSD: Computing the Sheaf Instead of Learning It

11 minute read

Published:

Neural Sheaf Diffusion learns the restriction maps by gradient descent. Conn-NSD computes them once, before training, by assuming the data lies on a manifold and optimally aligning neighbouring tangent spaces, matching the learned models on small graphs at roughly half the cost per epoch.

BrainDyn: Sheaves Meet Neural ODEs for Brain Dynamics

11 minute read

Published:

Brain regions do not encode information in a shared feature space, which is exactly the assumption scalar message passing makes. BrainDyn puts learnable restriction maps between regions and integrates the result as a continuous-time system, the first pairing of cellular sheaves with neural ODEs.

DNSD: Making Sheaf Diffusion Work at Depth

12 minute read

Published:

Neural Sheaf Diffusion has a theoretical guarantee against representation collapse that does not survive contact with depth. DNSD diagnoses why, the Laplacian’s disagreement signal vanishes as diffusion succeeds, and replaces the operator rather than patching around it.

SheafPool: Basis-Invariant Graph Readout for Sheaf Neural Networks

8 minute read

Published:

SheafPool solves a key missing piece in sheaf GNNs: graph-level pooling. Instead of averaging stalk vectors in arbitrary local bases, it aligns them into a shared canonical frame and builds a readout that is invariant to local basis changes.

PolyNSD: Polynomial Neural Sheaf Diffusion

10 minute read

Published:

PolyNSD replaces the NSD propagation operator with a degree-K Chebyshev polynomial in the normalised sheaf Laplacian, achieving SOTA on homo- and heterophilic benchmarks with only diagonal restriction maps and dramatically lower memory usage.

HetSheaf: Heterogeneous Graphs Meet Cellular Sheaves

9 minute read

Published:

HetSheaf encodes graph heterogeneity directly in the sheaf data structure, type-aware stalks and restriction maps conditioned on node and edge types, instead of specialised architectural components, achieving +2pp on HGB with 10× fewer parameters.

sheafpool

SheafPool: Basis-Invariant Graph Readout for Sheaf Neural Networks

8 minute read

Published:

SheafPool solves a key missing piece in sheaf GNNs: graph-level pooling. Instead of averaging stalk vectors in arbitrary local bases, it aligns them into a shared canonical frame and builds a readout that is invariant to local basis changes.

sheaves

Gauges: When There Is No Shared Frame

7 minute read

Published:

The previous chapter ended on an arbitrary choice that could not be eliminated. Gauge theory’s answer is to stop trying: keep every local frame, transport between them explicitly, and require the model to be indifferent to which frames you picked.

shortest-path

Shortest-Path Encodings for Graph Transformers

6 minute read

Published:

Shortest-path distances between nodes can be encoded as attention biases or node features, directly informing the model about graph proximity without requiring message passing.

shrinkage

Estimators, Bias and Variance: Why Unbiased Is Not the Same as Good

6 minute read

Published:

An estimator is a random variable, so it has a mean and a spread. Squared error splits exactly into those two pieces, and once you see the split, it becomes obvious that deliberately biasing an estimator can make it strictly better.

sigmoid

Activation Functions in Neural Networks: Why Non-Linearity Matters

7 minute read

Published:

Activation functions are the reason neural networks can model curved decision boundaries instead of collapsing into one giant linear map. This chapter builds the intuition first, then walks through the classical functions that shaped deep learning.

Logistic Regression: Linear in the Log-Odds

19 minute read

Published:

Logistic regression is not a squashed linear regression, it is a straight line drawn in log-odds space, which is why one coefficient means one multiplication of the odds, and why perfectly separable data drives that coefficient to infinity.

sign-ambiguity

Sign Ambiguity in Laplacian Eigenvectors

9 minute read

Published:

Laplacian eigenvectors are only defined up to sign: if u is an eigenvector, so is -u. This seemingly minor issue creates a fundamental problem for learning with LapPE. Here is the problem, its consequences, and how SignNet solves it.

silu

simple

SGC: Simple Graph Convolution

7 minute read

Published:

SGC removes all nonlinearities between GCN layers and collapses the entire propagation into a single pre-computed matrix power. Surprisingly, it matches GCN on most benchmarks, revealing that nonlinearities between layers may be unnecessary.

simplicial-complexes

Message Passing on Simplicial Complexes

20 minute read

Published:

A simplex has four kinds of neighbour rather than one, and separating them lets a network see the difference between a filled triangle and an empty one, a distinction no graph neural network can make.

Topological Deep Learning Is Not Topological Data Analysis

17 minute read

Published:

TDA computes a topological descriptor and hands it to a model; TDL makes the topological object the domain the model runs on. Telling the two apart is the difference between a preprocessing step and an architecture.

simulation

GNNs for Robotics: Planning, Manipulation, and Multi-Agent Systems

8 minute read

Published:

Robots interact with structured environments: objects have relationships, joints form kinematic chains, agents communicate through interaction graphs. GNNs encode these relational structures, enabling generalisation across object configurations, robot morphologies, and multi-agent scenarios.

sinusoidal

Sinusoidal Positional Encodings: The Original Solution

3 minute read

Published:

The PE method from the 2017 ‘Attention Is All You Need’ paper uses sine and cosine waves at different frequencies. Learn why this elegant choice encodes position without any training.

siren

Output and Gated Activations: Softmax, Sparsemax, GLU, and SIREN

6 minute read

Published:

The last activation in your network is not a modelling preference, it is a contract with your loss function. Break it and training stops meaning anything. Here is the contract, and what changes when the activation itself becomes learned.

skeleton

GNNs for Computer Vision: Scene Graphs and Beyond

8 minute read

Published:

Computer vision tasks increasingly require relational reasoning, understanding how objects relate to each other, not just what they are. Scene graph generation, visual question answering, action recognition from skeletons, and 3D point cloud processing all benefit from GNN-based relational modelling.

skip-connections

Residual Connections: Why Transformers Can Be Deep

7 minute read

Published:

Without residual connections, training a 96-layer Transformer would be practically impossible. The skip connection is a simple addition that solves the vanishing gradient problem and enables arbitrary depth.

slerp

slicing

snapshot

Static vs Dynamic Graphs: When Structure Changes Over Time

6 minute read

Published:

Most GNN research assumes a fixed graph. Real graphs evolve: edges appear and disappear, node features drift, new nodes arrive. Dynamic graph learning addresses how to model and predict on graphs whose structure changes over time.

social-network

GNNs for Social Networks: Influence, Communities, and Misinformation

7 minute read

Published:

Social networks are large sparse graphs with rich node features (user profiles) and heterogeneous edges (friendship, follow, retweet). GNNs predict user behaviour, detect communities, identify influential spreaders, and flag misinformation, tasks with significant real-world impact.

soft-assignment

DiffPool: Learning Hierarchical Graph Pooling

8 minute read

Published:

DiffPool learns to hierarchically cluster nodes into super-nodes across layers, like a convolutional pyramid for graphs. Unlike flat global pooling, it captures multi-scale graph structure by differentiably assigning nodes to clusters.

softmax

Output and Gated Activations: Softmax, Sparsemax, GLU, and SIREN

6 minute read

Published:

The last activation in your network is not a modelling preference, it is a contract with your loss function. Break it and training stops meaning anything. Here is the contract, and what changes when the activation itself becomes learned.

Logistic Regression: Linear in the Log-Odds

19 minute read

Published:

Logistic regression is not a squashed linear regression, it is a straight line drawn in log-odds space, which is why one coefficient means one multiplication of the odds, and why perfectly separable data drives that coefficient to infinity.

sorting

sparse

The Hardware Lottery: Why the Dense Version Won

6 minute read

Published:

Message passing on a sparse graph does asymptotically less work than attention over every pair. It is still the slower one to train. This chapter is about why the architecture that wins is the one your hardware happens to like.

sparse-pooling

TopKPool and SAGPool: Sparse Graph Pooling

8 minute read

Published:

Instead of soft cluster assignment (DiffPool), TopKPool and SAGPool select a subset of the most important nodes, producing a smaller but sparser graph at each level. Hard selection is scalable but requires careful score learning.

sparsemax

Output and Gated Activations: Softmax, Sparsemax, GLU, and SIREN

6 minute read

Published:

The last activation in your network is not a modelling preference, it is a contract with your loss function. Break it and training stops meaning anything. Here is the contract, and what changes when the activation itself becomes learned.

sparsification

sparsity

Norms, Inner Products, and the Geometry Behind L1 Sparsity

7 minute read

Published:

L1 regularisation produces exact zeros and L2 does not. The reason is not statistical, it is geometric: the L1 unit ball has corners on the axes, and corners are what optimisation solutions stick to.

spatio-temporal

GNNs for Traffic Forecasting

8 minute read

Published:

Traffic prediction is a canonical spatio-temporal graph task: sensors on roads form a fixed graph, and speed/volume measurements evolve over time. GNNs capture spatial correlations between sensors; RNNs or convolutions capture temporal patterns. Together they achieve state-of-the-art traffic forecasting.

Spatio-Temporal GNNs: Learning on Graphs Through Time

8 minute read

Published:

Spatio-temporal GNNs combine spatial message passing with temporal sequence modelling. They are the dominant approach for traffic forecasting, weather prediction, and any task where measurements at sensor nodes evolve over time on a fixed graph.

spectral

Polynomial Neural Sheaf Diffusion

8 minute read

Published:

Polynomial Neural Sheaf Diffusion (PNSD) replaces the fixed diffusion operator (I - Δ_F) with a learnable polynomial of the Sheaf Laplacian. This gives the model spectral flexibility, it can learn to amplify or suppress different frequency components of the sheaf signal.

The Sheaf Laplacian: Spectral Theory for Sheaves

7 minute read

Published:

The Sheaf Laplacian generalises the graph Laplacian by incorporating per-edge restriction maps. Its spectrum reveals how consistent data is under the sheaf. Sheaf diffusion with this Laplacian generalises GCN to handle heterophilic graphs.

Graph Fourier Transform: The Spectral View of Graphs

8 minute read

Published:

The Graph Fourier Transform decomposes a signal on a graph into frequency components using the Laplacian’s eigenvectors. This spectral view is the mathematical foundation behind spectral GNNs like ChebNet and GCN.

GCN: Graph Convolutional Networks

5 minute read

Published:

GCN (Kipf & Welling, 2016) is the ‘hello world’ of GNNs. It simplifies spectral graph convolution into a single elegant layer: normalised neighbourhood averaging with a learned linear transformation.

The Graph Laplacian: Spectral Graph Theory Explained Simply

6 minute read

Published:

The Graph Laplacian is L = D - A. Its eigenvectors reveal the graph’s community structure; its eigenvalues tell you how well-connected the graph is. It’s also the mathematical bridge from spectral theory to GNNs like GCN.

spectral-gnn

PolyNSD: Polynomial Neural Sheaf Diffusion

10 minute read

Published:

PolyNSD replaces the NSD propagation operator with a degree-K Chebyshev polynomial in the normalised sheaf Laplacian, achieving SOTA on homo- and heterophilic benchmarks with only diagonal restriction maps and dramatically lower memory usage.

spectral-methods

Sheaf-Based Positional Encodings: Letting Node Features Into the Spectrum

12 minute read

Published:

Laplacian eigenvector positional encodings tell a node where it sits in the graph, but the graph Laplacian only knows adjacency, so two structurally identical nodes get identical encodings no matter how different their features are. Swap in the sheaf Laplacian and the features enter the spectrum.

spectral-sheaf-theory

spectral-theorem

Eigenvectors, the Spectral Theorem, and Why the SVD Always Exists

7 minute read

Published:

Eigenvectors are the directions a matrix does not rotate, when they exist. The SVD asks a weaker question that always has an answer, and that is exactly why it, not the eigendecomposition, is the workhorse of applied linear algebra.

spherical-harmonics

SE(3)-Transformers: Attention with 3D Symmetry

9 minute read

Published:

SE(3)-Transformers extend self-attention to 3D point clouds and molecular graphs while maintaining SE(3) equivariance. Attention weights are learned between node pairs; values are equivariant features built from spherical harmonics.

stable-diffusion

Latent Diffusion: Denoise Where the Information Is

6 minute read

Published:

Most of the bits in a photograph encode texture no one can see. Latent diffusion throws them away first with an autoencoder, then runs the entire diffusion process in a space roughly forty-eight times smaller, which is how Stable Diffusion fits on a consumer GPU.

stacks

stalk

What Is a Sheaf? From Topology to Graph Learning

8 minute read

Published:

A sheaf is a mathematical object from algebraic topology that assigns vector spaces to cells and linear maps between them. On graphs, sheaves assign feature spaces to nodes and edges, with restriction maps encoding how node features relate across edges.

standard-error

Confidence Intervals: The Interval Is Random, the Parameter Is Not

5 minute read

Published:

A 95% confidence interval does not say the parameter is 95% likely to be inside it. It says the recipe that produced the interval succeeds 95% of the time. That distinction is the single most-failed question in statistics interviews.

statistical-mechanics

Statistical Mechanics: The Boltzmann Distribution and the Cost of Z

6 minute read

Published:

Counting microstates gives you the Boltzmann distribution, and the Boltzmann distribution gives you softmax, simulated annealing and energy-based models. The partition function is not a bookkeeping constant, it is the object that contains every thermodynamic quantity, and it is intractable for exactly that reason.

Physics for Machine Learning: Why the Same Equations Keep Coming Back

5 minute read

Published:

Diffusion models, energy-based models and Hamiltonian Monte Carlo were not inspired by physics, they are physics, rewritten with a neural network in place of an analytic potential. Knowing which physics saves you from re-deriving it badly.

statistical-power

Hypothesis Testing: What a p-Value Actually Measures

7 minute read

Published:

A p-value answers one narrow question: if nothing were going on, how often would data look at least this extreme? It says nothing about whether the effect is real, large, or worth shipping, and running twenty of them changes the meaning of all twenty.

statistics

Statistics Basics: Reasoning Backwards From Data to Model

5 minute read

Published:

Probability runs forwards: pick a model, predict the data. Statistics runs backwards, and backwards is harder, many models could have produced what you saw. Everything else in this book is machinery for handling that ambiguity honestly.

steerable-cnn

Groups: Equivariance Beyond Translation

6 minute read

Published:

Translation is one group. Swap it for rotations, reflections, or the rigid motions of 3-D space and the same construction produces a different architecture, with the parameter count cut by exactly the size of the orbit.

streaming

Static vs Dynamic Graphs: When Structure Changes Over Time

6 minute read

Published:

Most GNN research assumes a fixed graph. Real graphs evolve: edges appear and disappear, node features drift, new nodes arrive. Dynamic graph learning addresses how to model and predict on graphs whose structure changes over time.

strings

structural-encoding

Structural vs Positional Encodings in Graphs

7 minute read

Published:

Positional encodings say where a node is in the graph. Structural encodings say what role it plays. They are complementary, and confusing them leads to poor design choices.

Why GNNs Need Positional Encodings

7 minute read

Published:

Message-passing GNNs are permutation-equivariant by design, they cannot assign unique positions to nodes. Without positional encodings, symmetric nodes are indistinguishable. Here is why that matters and how to fix it.

Graphormer: Transformers with Structural Biases for Graphs

9 minute read

Published:

Graphormer encodes graph structure directly into Transformer attention via three biases: node centrality, spatial encoding (shortest paths), and edge encoding. It won the OGB-LSC 2021 competition on molecular property prediction.

style-transfer

Z-SASLM: Zero-Shot Style Blending via Spherical Interpolation

9 minute read

Published:

Z-SASLM is a zero-shot, fine-tuning-free style blending pipeline that replaces linear latent interpolation with SLERP along the geodesic of the hypersphere, preserving latent manifold structure when blending multiple styles. Published at CVPR 2025 Workshop.

supervised

Machine Learning Before Transformers: A Working Foundation

4 minute read

Published:

Every later book on this site assumes you already know what a loss is, why gradient descent works, and what a convolution buys you. This book supplies that, and follows one thread through it: how much structure you build in versus how much you let the data decide.

surfaces

Curvature: Why a Flat Map of the Earth Must Lie

6 minute read

Published:

Curvature at a point is one over the radius of the circle that best hugs the curve there. Push that idea up to surfaces and Gauss’s Theorema Egregium falls out: some curvature is visible from inside the surface, which is why no map projection can ever get distances right.

svd

Linear Maps as Geometry: Rotate, Scale, Rotate

6 minute read

Published:

A matrix is not a table of numbers, it is a deformation of space. The SVD says every deformation is the same three moves in sequence: rotate, stretch along axes, rotate again.

Eigenvectors, the Spectral Theorem, and Why the SVD Always Exists

7 minute read

Published:

Eigenvectors are the directions a matrix does not rotate, when they exist. The SVD asks a weaker question that always has an answer, and that is exactly why it, not the eigendecomposition, is the workhorse of applied linear algebra.

PCA: Maximum Variance and Minimum Reconstruction Error

6 minute read

Published:

PCA can be derived by asking for the directions of greatest spread, or by asking for the subspace that loses the least when you project onto it. The two questions look unrelated and have the same answer, which is the most useful thing to understand about it.

svm

Euclidean Space: Inner Products, Projections and the Margin

6 minute read

Published:

One bilinear form generates the whole of flat geometry: lengths, angles, orthogonality, projections and the distance from a point to a hyperplane. Get the projection formula and you get the SVM margin for free.

Support Vector Machines: Margins and the Kernel Trick

8 minute read

Published:

Among all the hyperplanes that separate two classes, one sits furthest from both. Finding it turns out to depend on the data only through inner products, and that single fact is what lets you work in a space you never build.

swiglu

Output and Gated Activations: Softmax, Sparsemax, GLU, and SIREN

6 minute read

Published:

The last activation in your network is not a modelling preference, it is a contract with your loss function. Break it and training stops meaning anything. Here is the contract, and what changes when the activation itself becomes learned.

swish

symmetry

Noether’s Theorem: Symmetry, Conservation, and Equivariant Networks

6 minute read

Published:

Energy is conserved because the laws of physics do not care what time it is. That single sentence is Noether’s theorem, and its machine learning descendant is the reason an equivariant network needs less data than one that must learn the symmetry from examples.

Geometry for Machine Learning: Why Shape Keeps Coming Back

5 minute read

Published:

Every embedding you have ever trained lives in a metric space, every dataset you have ever fitted sits near a surface far thinner than its ambient dimension, and every architecture you trust encodes a symmetry. Geometry is not decoration on top of ML, it is what makes the problems tractable.

Permutation Symmetry and the Message-Passing Blueprint

7 minute read

Published:

A graph’s nodes have no canonical order, so any model that reads one must give the same answer under relabelling. That single requirement forces the three-step message, aggregate, update template, it is not a design choice.

Geometric Deep Learning: One Blueprint Behind Every Architecture

6 minute read

Published:

CNNs, GNNs, Transformers and sheaf models look like separate inventions. They are the same recipe applied to different domains: identify the symmetry of your data, then build layers that respect it. This book is that recipe, and the arguments that follow from it.

Equivariance: What It Means and Why It Matters

9 minute read

Published:

Equivariance formalises the idea that a function should ‘commute with symmetry transformations.’ A rotation-equivariant model applied to rotated input gives the rotated output, no extra training needed. This is the foundation for geometric deep learning.

Why Geometry Matters in Graph Neural Networks

7 minute read

Published:

Many real-world graphs are embedded in 3D space, molecules, proteins, point clouds, crystal structures. Standard GNNs ignore coordinates and only use connectivity. Geometric GNNs incorporate spatial positions and must respect physical symmetries.

Why GNNs Need Positional Encodings

7 minute read

Published:

Message-passing GNNs are permutation-equivariant by design, they cannot assign unique positions to nodes. Without positional encodings, symmetric nodes are indistinguishable. Here is why that matters and how to fix it.

symmetry-breaking

Equivariant Sheaf Neural Networks: Learning Geometric Transport on Graphs

33 minute read

Published:

Sheaf networks move features through matrix-valued maps but ignore the symmetries of physical space; equivariant GNNs respect those symmetries but move vectors with scalars. ESNN does both, learned, directed, matrix-valued transport that is exactly E(n)-equivariant, and proves that when displacement is the only geometric input, the radial–tangential family is all the linear transport there is.

symplectic

Hamiltonian Dynamics: Phase Space, Liouville, and Why HMC Works

6 minute read

Published:

Hamiltonian Monte Carlo is not a heuristic that happens to move well. It is exact because Hamiltonian flow preserves phase-space volume and is reversible, which is what makes the Metropolis acceptance ratio collapse to a difference of energies.

t-distribution

Confidence Intervals: The Interval Is Random, the Parameter Is Not

5 minute read

Published:

A 95% confidence interval does not say the parameter is 95% likely to be inside it. It says the recipe that produced the interval succeeds 95% of the time. That distinction is the single most-failed question in statistics interviews.

tangent-space

tanh

Activation Functions in Neural Networks: Why Non-Linearity Matters

7 minute read

Published:

Activation functions are the reason neural networks can model curved decision boundaries instead of collapsing into one giant linear map. This chapter builds the intuition first, then walks through the classical functions that shaped deep learning.

tda

Topological Deep Learning Is Not Topological Data Analysis

17 minute read

Published:

TDA computes a topological descriptor and hands it to a model; TDL makes the topological object the domain the model runs on. Telling the two apart is the difference between a preprocessing step and an architecture.

temperature

Statistical Mechanics: The Boltzmann Distribution and the Cost of Z

6 minute read

Published:

Counting microstates gives you the Boltzmann distribution, and the Boltzmann distribution gives you softmax, simulated annealing and energy-based models. The partition function is not a bookkeeping constant, it is the object that contains every thermodynamic quantity, and it is intractable for exactly that reason.

temporal

Temporal Graph Networks: Learning from Events

8 minute read

Published:

TGN (Temporal Graph Network) is the leading framework for continuous-time dynamic graphs. It maintains a per-node memory that is updated upon each interaction, enabling efficient inductive link prediction on event streams.

Static vs Dynamic Graphs: When Structure Changes Over Time

6 minute read

Published:

Most GNN research assumes a fixed graph. Real graphs evolve: edges appear and disappear, node features drift, new nodes arrive. Dynamic graph learning addresses how to model and predict on graphs whose structure changes over time.

temporal-KG

Temporal Knowledge Graphs: Facts That Change Over Time

7 minute read

Published:

Most knowledge graphs treat facts as timeless, but facts change. Barack Obama was president from 2009 to 2017. Temporal Knowledge Graphs add timestamps to triples, requiring models to reason about what was true when.

tensor-field-networks

Tensor Field Networks and Geometric Deep Learning

8 minute read

Published:

Tensor Field Networks (TFN) were the first architecture to achieve SE(3) equivariance using spherical harmonics and Clebsch-Gordan tensor products. They laid the theoretical foundation for NequIP and MACE, the current state-of-the-art in equivariant molecular force fields.

theorema-egregium

Curvature: Why a Flat Map of the Earth Must Lie

6 minute read

Published:

Curvature at a point is one over the radius of the circle that best hugs the curve there. Push that idea up to surfaces and Gauss’s Theorema Egregium falls out: some curvature is visible from inside the surface, which is why no map projection can ever get distances right.

thermodynamics

Entropy and Free Energy: From the Second Law to the ELBO

6 minute read

Published:

Thermodynamic entropy and Shannon entropy differ by a constant with units. Once you accept that, the ELBO stops being an inference trick and becomes a free energy, and diffusion models stop being a clever architecture and become a driven non-equilibrium process.

Physics for Machine Learning: Why the Same Equations Keep Coming Back

5 minute read

Published:

Diffusion models, energy-based models and Hamiltonian Monte Carlo were not inspired by physics, they are physics, rewritten with a neural network in place of an analytic potential. Knowing which physics saves you from re-deriving it badly.

threads

time-aware

Temporal Knowledge Graphs: Facts That Change Over Time

7 minute read

Published:

Most knowledge graphs treat facts as timeless, but facts change. Barack Obama was president from 2009 to 2017. Temporal Knowledge Graphs add timestamps to triples, requiring models to reason about what was true when.

topkpool

TopKPool and SAGPool: Sparse Graph Pooling

8 minute read

Published:

Instead of soft cluster assignment (DiffPool), TopKPool and SAGPool select a subset of the most important nodes, producing a smaller but sparser graph at each level. Hard selection is scalable but requires careful score learning.

topological-deep-learning

Beyond Simplices: Cell and Combinatorial Complexes

20 minute read

Published:

A simplicial complex cannot hold a benzene ring as a single cell, filling the hexagon costs three edges between atoms that share no bond, and this one constraint is what cell and combinatorial complexes exist to remove.

Message Passing on Simplicial Complexes

20 minute read

Published:

A simplex has four kinds of neighbour rather than one, and separating them lets a network see the difference between a filled triangle and an empty one, a distinction no graph neural network can make.

Topological Deep Learning Is Not Topological Data Analysis

17 minute read

Published:

TDA computes a topological descriptor and hands it to a model; TDL makes the topological object the domain the model runs on. Telling the two apart is the difference between a preprocessing step and an architecture.

topology

total-variation

Sheaf Hypergraph Networks: Apparent Consensus in Higher-Order Relations

13 minute read

Published:

A graph edge relates two things. A hyperedge relates any number of them, and hypergraph networks aggregate over it uniformly, every member contributes the same way. Attaching a sheaf gives each member its own linear map into the group, and turns forced consensus into apparent consensus.

tracebacks

Errors and Exceptions: EAFP, the Hierarchy, and Reading a Traceback

7 minute read

Published:

Exceptions in Python are not exceptional. They are a normal control-flow mechanism that the language leans on so heavily that the idiomatic style is to try the operation and handle the failure, rather than check first, which is faster, shorter, and free of race conditions.

traffic

GNNs for Traffic Forecasting

8 minute read

Published:

Traffic prediction is a canonical spatio-temporal graph task: sensors on roads form a fixed graph, and speed/volume measurements evolve over time. GNNs capture spatial correlations between sensors; RNNs or convolutions capture temporal patterns. Together they achieve state-of-the-art traffic forecasting.

Spatio-Temporal GNNs: Learning on Graphs Through Time

8 minute read

Published:

Spatio-temporal GNNs combine spatial message passing with temporal sequence modelling. They are the dominant approach for traffic forecasting, weather prediction, and any task where measurements at sensor nodes evolve over time on a fixed graph.

training

DDPM Training: From a Variational Bound to Four Lines of PyTorch

5 minute read

Published:

The DDPM objective starts as a variational bound with T+1 KL terms and ends as a plain mean-squared error on noise. Following the collapse shows why the discarded weighting term is not an approximation you tolerate but a reweighting that improves samples.

training stability

Layer Normalization in Transformers

6 minute read

Published:

Layer norm is not optional plumbing. It determines training stability, gradient flow, and whether deep Transformers converge at all. Pre-LN vs Post-LN is not a detail, it changes training dynamics fundamentally.

transformation

APPNP: Personalized PageRank Meets Graph Neural Networks

7 minute read

Published:

APPNP decouples feature transformation from propagation. A neural network transforms features first; then Personalized PageRank propagates the result. This enables deep propagation without over-smoothing.

transformations

Linear Maps as Geometry: Rotate, Scale, Rotate

6 minute read

Published:

A matrix is not a table of numbers, it is a deformation of space. The SVD says every deformation is the same three moves in sequence: rotate, stretch along axes, rotate again.

transformer-block

The Transformer Block: Putting It All Together

6 minute read

Published:

A single Transformer block combines attention, residuals, layer norm, and an FFN into one reusable unit. Understanding this block is understanding the Transformer.

transformers

Transformers Are GNNs on Fully Connected Graphs

6 minute read

Published:

Write self-attention in the message-passing template and you get the Graph Attention Network equations with one substitution: the neighbourhood becomes the whole input. The two architectures are not analogous, they are the same operator on different graphs.

GAPE: Remember to Forget, Gated Adaptive Positional Encoding

9 minute read

Published:

GAPE is a drop-in RoPE augmentation that adds content-aware attention logit biases: a query-gate suppresses irrelevant distant context while a key-gate preserves salient distant tokens. Provably sharper attention and improved long-context robustness, no architecture changes needed.

translation-equivariance

Grids: Why Translation Equivariance Forces Convolution

5 minute read

Published:

Convolution is not a clever idea someone had about images. It is the only linear map that commutes with translation, a theorem, not a design choice, and one you can verify by exhaustion on a small enough case.

traversals

trees

tries

tsne

PCA: Maximum Variance and Minimum Reconstruction Error

6 minute read

Published:

PCA can be derived by asking for the directions of greatest spread, or by asking for the subspace that loses the least when you project onto it. The two questions look unrelated and have the same answer, which is the most useful thing to understand about it.

tuples

type-hints

types

Names, Not Boxes: Python Syntax, Variables and the Built-in Types

7 minute read

Published:

A Python variable is not a container that holds a value, it is a label stuck onto an object that lives somewhere else. Almost every early surprise, from shared lists to 0.1 + 0.2, follows from taking that sentence literally.

typing

uncertainty

Bayesian Sheaf Neural Networks: Putting a Distribution on the Geometry

13 minute read

Published:

If a sheaf neural network learns its geometry from data, it can learn the wrong geometry and have no way of knowing. Treating the sheaf Laplacian as a latent random variable fixes that, but requires a reparameterisable distribution on SO(n) with a tractable density, which did not exist.

unicode

unified

MPNN: The General Message Passing Neural Network Framework

6 minute read

Published:

The MPNN framework (Gilmer et al., 2017) unifies GCN, GAT, GIN, GraphSAGE, and almost all spatial GNNs under one abstraction: message functions, aggregation, and update. Understanding MPNN means understanding the whole GNN family.

union-find

unsupervised

Machine Learning Before Transformers: A Working Foundation

4 minute read

Published:

Every later book on this site assumes you already know what a loss is, why gradient descent works, and what a convolution buys you. This book supplies that, and follows one thread through it: how much structure you build in versus how much you let the data decide.

v-prediction

vanishing-gradients

RNNs, LSTMs, and GRUs: Sequence Models Before Attention

6 minute read

Published:

A recurrent network shares weights across time exactly as a convolution shares them across space. The trouble is that gradients then travel through a product of Jacobians, and a product of a hundred numbers slightly below one is zero.

variables

Names, Not Boxes: Python Syntax, Variables and the Built-in Types

7 minute read

Published:

A Python variable is not a container that holds a value, it is a label stuck onto an object that lives somewhere else. Almost every early surprise, from shared lists to 0.1 + 0.2, follows from taking that sentence literally.

variance

Expectation and Variance: Linearity Is Free, Additivity Is Not

5 minute read

Published:

Expectation adds up no matter how tangled the dependence. Variance does not, and the correction term, covariance, is where most of the interesting behaviour of ensembles, portfolios and minibatch gradients lives.

variational-inference

Bayesian Sheaf Neural Networks: Putting a Distribution on the Geometry

13 minute read

Published:

If a sheaf neural network learns its geometry from data, it can learn the wrong geometry and have no way of knowing. Treating the sheaf Laplacian as a latent random variable fixes that, but requires a reparameterisable distribution on SO(n) with a tractable density, which did not exist.

variational-principles

Lagrangian Mechanics: Why Nature Optimises a Functional

6 minute read

Published:

Newton says a particle moves because a force pushes it. Lagrange says it moves along the path that makes the action stationary. The second statement is harder to believe and far easier to use, and it is the one machine learning inherited.

video

virtualenv

Modules, Packages, and How Python Actually Finds Your Code

7 minute read

Published:

An import is not a textual include, it executes a file once, caches the result, and binds a name. Almost every confusing import error, from circular imports to ‘attempted relative import with no known parent package’, follows directly from that one sentence.

visual-question-answering

GNNs for Computer Vision: Scene Graphs and Beyond

8 minute read

Published:

Computer vision tasks increasingly require relational reasoning, understanding how objects relate to each other, not just what they are. Scene graph generation, visual question answering, action recognition from skeletons, and 3D point cloud processing all benefit from GNN-based relational modelling.

wave-equation

Surfing on the Neural Sheaf: What Happens If You Use the Wave Equation

9 minute read

Published:

Every sheaf model so far discretises the heat equation, which dissipates energy. Suk et al. try the wave equation instead, which conserves it, a one-line change of PDE with a clean theoretical motivation and a genuinely mixed empirical result.

weighted

wl-test

GIN: Graph Isomorphism Network, The Most Expressive GNN

5 minute read

Published:

How powerful can a GNN be? Xu et al. (2019) answered with a theoretical bound, and GIN is the architecture that achieves it. The secret: use sum aggregation and an MLP, not mean or max.