Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Frequencies on a graph
A sound can be split into low and high frequencies; so can a signal living on a graph. Slowly varying patterns, where neighbours have similar values, are low frequencies; patterns that flip between neighbours are high frequencies. Spectral GNNs learn which frequencies to keep. ChebNet does this cheaply with a polynomial that only looks a few hops around each node. The demo plots such a polynomial filter over the graph’s frequencies.
Graph filters denoise sensor networks, smooth measurements on meshes and power grids, and underlie the GCN, the most widely used graph network.
- 1. A low-frequency graph signal has…
- 2. ChebNet's filters are…
- 3. A degree-K ChebNet filter looks…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- Normalised Laplacian: L = I − D^(−1/2) A D^(−1/2), with eigenvalues in [0, 2] and eigenvectors U, the graph Fourier basis.
- Spectral filtering: y = U h(Λ) Uᵀ x, where h acts on each frequency (eigenvalue). The heat kernel h(λ) = e^(−τλ) is a low-pass filter.
- Chebyshev approximation:
- h(λ) ≈ Σ_(k=0)^K θ_k T_k(λ̃), with λ̃ = 2λ/λ_max − 1 in [−1, 1] (λ = 0 maps to −1, λ = 2 to 1 for λ_max = 2);
- the polynomials satisfy T_0 = 1, T_1 = x and T_k = 2x T_(k−1) − T_(k−2): T_2(0.5) = −0.5 and T_3(0.5) = −1;
- so y = Σ θ_k T_k(L̃) x needs only K sparse products with L̃.
- Locality: (L̃^k)_ij = 0 when i and j are more than k hops apart, so the filter is exactly K-hop localised.
- Parameters: (K + 1) coefficients per input–output channel pair, 16 × 32 × 4 = 2048 for K = 3.
- 1. T_2(x):
- 2. Scaled eigenvalue for λ = 1, λ_max = 2:
- 3. Eigenvalues of the normalised Laplacian lie in…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.ChebNet in code
Exercise 1.
- The recurrence matched T_2 and T_3, and cos(3 arccos x).
- The scaled Laplacian of a 2-node graph was [[0, −1], [−1, 0]].
- The Chebyshev filter matched direct spectral filtering through the eigendecomposition.
Practice.
- PyTorch Geometric’s
ChebConv(in, out, K)implements ChebNet. Use λ_max = 2 for the normalised Laplacian, or estimate it. - K = 2–3 is common. For very large graphs, use sparse tensors and precompute the scaled Laplacian.
- Spectral filters are tied to one graph’s Laplacian; for many different graphs, spatial message passing is more natural.
Lt = 2 * L / lmax - I # scaled Laplacian (sparse)
T0, T1 = x, Lt @ x
out = T0 @ theta[0] + T1 @ theta[1]
for k in range(2, K + 1):
T0, T1 = T1, 2 * Lt @ T1 - T0 # Chebyshev recurrence: one sparse product per order
out = out + T1 @ theta[k]- 1. PyTorch Geometric layer for ChebNet:
- 2. Typical K:
- 3. Spectral filters are tied to…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Graph Fourier transform.
- The Laplacian’s eigenvectors are ordered by smoothness: the quadratic form xᵀLx = ½ Σ_(ij) A_ij (x_i/√d_i − x_j/√d_j)² is small for smooth signals.
- The eigenvalue measures each eigenvector’s variation, its frequency. Filtering scales each frequency component.
Why polynomials.
- Early spectral networks (Bruna and colleagues, 2014) learned one parameter per eigenvalue: O(n) parameters, an O(n³) eigendecomposition, and filters that are not localised.
- A polynomial filter of degree K has K + 1 parameters, costs O(K·|E|), and is K-hop localised.
- Chebyshev polynomials are the natural basis on [−1, 1]: they are stable to compute and give near-best uniform approximations of smooth functions (Hammond and colleagues used them for graph wavelets in 2011).
Towards GCN. Setting K = 1 and λ_max ≈ 2 and tying the two coefficients gives the GCN layer (next page).
- 1. xᵀLx is small for…
- 2. Bruna et al.'s spectral networks needed…
- 3. GCN is ChebNet with…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.How low an order is enough?
History.
- J. Bruna, W. Zaremba, A. Szlam and Y. LeCun, “Spectral networks and locally connected networks on graphs” (ICLR 2014).
- M. Defferrard, X. Bresson and P. Vandergheynst, “Convolutional neural networks on graphs with fast localized spectral filtering” (NeurIPS 2016).
- D. Hammond, P. Vandergheynst and R. Gribonval (2011) introduced graph wavelets with Chebyshev approximation.
Exercise 2.
- Graph and signal: a 10 × 10 grid graph carrying the smooth signal sin(x/3) + cos(y/4), plus noise of standard deviation 0.5.
- Filter: the heat kernel h(λ) = e^(−4λ), applied exactly (through the eigendecomposition) and with Chebyshev approximations of order K.
- Measurements: the maximum approximation error of h over the graph’s eigenvalues, the denoising error (MSE against the clean signal), and the largest filter-matrix entry beyond K hops.
| order K | max error of h | denoising MSE | largest entry beyond K hops |
|---|---|---|---|
| 1 | 0.436 | 0.254 | 0 |
| 2 | 0.200 | 0.067 | 0 |
| 3 | 0.078 | 0.029 | 0 |
| 5 | 0.0076 | 0.025 | 0 |
| 10 | 0.0000 | 0.026 | 0 |
Noisy signal MSE 0.233; exact spectral filter 0.026.
- Order 3 is already enough: with 3 sparse products, it reaches 0.029, within 10% of the exact filter’s 0.026, and removes 88% of the noise.
- Order 1 is too crude: a straight line cannot follow the heat kernel’s curve, and the result (0.254) is worse than not filtering.
- Locality is exact: every order-K filter matrix was exactly zero beyond K hops, as the theory says.
- Order 10 reproduces the exact filter (approximation error below 10⁻⁴). Order 5 was marginally better than exact (0.025), a chance effect of a slightly different filter shape.
- Seeds: noise seeds 1 and 2 gave order-3 errors of 0.036 and 0.022 against exact 0.025 and 0.016.
Spectral GNNs in AI, robotics and aerospace
- Sensor networks: smoothing and interpolating readings over a network of weather stations, structural sensors or grid meters.
- Meshes: filtering and learning on surface meshes of aircraft parts and terrain.
- Design lesson: polynomial filters give a clean trade-off between locality, cost and frequency selectivity; a low order is usually enough.
References
- M. Defferrard, X. Bresson and P. Vandergheynst (2016). “Convolutional neural networks on graphs with fast localized spectral filtering.” NeurIPS.
- J. Bruna, W. Zaremba, A. Szlam and Y. LeCun (2014). “Spectral networks and locally connected networks on graphs.” ICLR.
- D. K. Hammond, P. Vandergheynst and R. Gribonval (2011). “Wavelets on graphs via spectral graph theory.” Applied and Computational Harmonic Analysis 30.