Session 3: Perceptrons, Backprop & CNNs
2026-10-19
8:30–11:30 · 180 min
| Time | Block |
|---|---|
| 8:30–8:32 | Recap: where we left off |
| 8:32–8:42 | Biology of a neuron |
| 8:42–8:45 | McCulloch-Pitts formal neuron |
| 8:45–9:00 | Perceptron: circuits, Hebbian rule, history & modern view |
| 9:00–9:05 | Impossibility theorem (XOR) |
| 9:05–9:15 | MLP & activation functions |
| 9:15–9:25 | ⚡ Exercise: XOR by hand |
| 9:25–9:40 | Backprop: Leibniz notation → MLP equations → vanishing/exploding |
| 9:40–9:45 | XOR with backprop |
| 9:45–10:00 | ☕ Break |
| 10:00–10:20 | Universal approximation theorem |
| 10:20–10:45 | Convolutions: equivariance, 1D & 2D |
| 10:45–10:55 | ⚡ Exercise: convolution and finite signals |
| 10:55–11:10 | History: LeNet → AlexNet → VGG |
| 11:10–11:25 | ResNet, residual connections & loss landscape |
| 11:25–11:30 | Wrap-up |
0:00–0:35 · 35 min
Signals are recorded as spike trains. Enough trains trigger the neuron to launch its own spikes
Threshold based ion channels create avalanche effects in difference of potential that travels like a wave
The formal neuron: a weighted sum of the inputs \(x_0,\dots,x_{d-1}\) plus a bias \(b\), passed through an activation function \(\sigma\).
\[ h(x) = \sigma(\langle w, x\rangle + b) \]
From the Perceptron’s manual (public domain)
AND, OR, NAND: a single hyperplane cutting \(\{0,1\}^2\). Neuron: a logic gate for a suitable choice of weights.
Perceptron impossibility. There exists a distribution on \((x \in \mathbb{R}^d, y\in\{0,1\})\) that cannot be learned by any predictor \(h(x) = \sigma(w^\top x + b)\) with \(\sigma\) strictly increasing.
The counter-example is XOR: \((0,0)\mapsto 0,\ (1,1)\mapsto 0,\ (0,1)\mapsto 1,\ (1,0)\mapsto 1\)
Let \(\theta\) be the unique threshold such that \(\sigma(\theta) > k\) reads as output \(1\). Solving XOR would require all four of \[ b \leq \theta,\\ \quad w_2+b > \theta,\\ \quad w_1+b > \theta,\\ \quad w_1+w_2+b \leq \theta \] Summing equations 1 and 4 gives \(w_1+w_2+2b \leq 2\theta\). Summing 2 and 3 gives \(w_1+w_2+2b > 2\theta\). Contradiction.
0:35–0:45 · 10 min
\[ f_i(x) = \big[\sigma(w_{ij}^\top x + b_{ij})\big]_{j \leq d_i}, \qquad F(x) = f_L \circ \cdots \circ f_1(x) \]
A multilayer perceptron: input \(x\) through 3 fully-connected layers.
Sigmoid, tanh, ReLU, Leaky ReLU, GeLU
0:45–0:55 · 10 min
Using a single hidden layer with only 2 neurons, equipped with the \(\mathrm{sign}\) activation, compute by hand weights that solve XOR.
0:55–1:15 · 20 min
\[ \hat{\mathcal{R}}_{\mathcal{A}}(F) = \frac1n \sum_{i=1}^n \ell(y_i, F(x_i)) \]
Simplify to a chain of scalar neurons, \(x_0 \to x_1 \to x_2 \to \ell\), with \(x_k = \sigma(w_k x_{k-1})\): \[ x_1 = \sigma(w_1 x_0), \qquad x_2 = \sigma(w_2 x_1), \qquad \ell = \ell(y, x_2) \]
Leibniz notation makes every intermediate variable explicit
\[ \frac{\partial \ell}{\partial w_2} = \frac{\partial \ell}{\partial x_2}\cdot \frac{\partial x_2}{\partial w_2} = \ell'(y,x_2)\cdot \sigma'(w_2 x_1)\, x_1 \]
\[ \frac{\partial \ell}{\partial w_1} = \frac{\partial \ell}{\partial x_2}\cdot \frac{\partial x_2}{\partial x_1}\cdot \frac{\partial x_1}{\partial w_1} = \underbrace{\ell'(y,x_2)\,\sigma'(w_2 x_1)}_{\text{reused from above}} \cdot\ w_2\, \sigma'(w_1 x_0)\, x_0 \]
Define \(\delta_2 = \ell'(y,x_2)\,\sigma'(w_2 x_1)\) (the “local gradient” at neuron 2)
\(\delta_1 = \delta_2\, w_2\, \sigma'(w_1 x_0)\). Then
\[ \frac{\partial \ell}{\partial w_2} = \delta_2\, x_1, \qquad \frac{\partial \ell}{\partial w_1} = \delta_1\, x_0 \]
Same recursion \[ \delta_L = \ell'(y, F(x)) \circ \sigma'(x_L), \qquad \delta_k = w_{k+1}^\top\big(\sigma'(x_{k+1}) \circ \delta_{k+1}\big) \] \[ \frac{\partial \ell}{\partial w_k} = \delta_k\, x_{k-1}^\top, \qquad \frac{\partial \ell}{\partial b_k} = \delta_k \]
pytorch, JAX)1:15–1:30 · 15 min
1:30–1:50 · 20 min
Universal approximation (sign). For all \(n\), the family of depth-2 MLPs with \(\mathrm{sign}\) activation contains every function from \(\{\pm1\}^n\) to \(\{\pm1\}\).
Proof sketch. Let \(\{u_i\}\) be the inputs with label \(1\). Since binary vectors differ by at least 2 bits, \(\langle x,u_i\rangle \leq n-2\) unless \(x=u_i\). One hidden neuron per \(u_i\), \(h_i(x) = \mathrm{sign}(u_i^\top x - n+1)\), fires only on \(x=u_i\). Output \(F(x) = \mathrm{sign}(\sum_i h_i(x) + k - 1)\) reproduces the label.
1:50–2:15 · 25 min
Equivariance. \(h\) is equivariant to an operator \(T\) if \(\forall x,\ h(Tx) = Th(x)\).
Convolution. \((h \star x)[n] = \sum_{k} x[n+k]\, h[k]\).
Kernel \([1, 0, -1]\): edge detector
\[ (x \star h)[m,n] = \sum_{k}\sum_{l} x[m+k,n+l]\, h[k,l] \]
Extract windows, flatten, matmul, reshape as image → parallel processing
2:15–2:25 · 10 min
Using the equivariance definition, construct a concrete example showing that convolution and translation do not commute for a finite (as opposed to infinite) signal.
2:25–2:40 · 15 min
LeNet-5 (LeCun et al., 1989): zip-code digit recognition.
2:40–2:55 · 15 min
ResNet-34 (He et al., 2016): each “+” is a residual shortcut added back into the main path.
\[ x_{l+1} = h_l(x_l) + x_l \]
Both trained to convergence. Axes are the top-2 Hessian eigenvectors at that point. Each panel’s own height scale, since they differ by orders of magnitude.
2:55–3:00 · 5 min