Take two steps at b1<b2 and subtract:
bump(x)=σ(w(x−b1))−σ(w(x−b2)).Why this step? The first step turns "on" at b1; the second turns "on" at b2. Subtracting means we're on (value ≈1) only for b1<x<b2, and off elsewhere — a rectangular bump of width b2−b1.
This needs 2 hidden neurons with output weights +1 and −1.
Divide the domain into many little intervals. On interval k put a bump of height hk:
F(x)=∑khk[σ(w(x−bk))−σ(w(x−bk+1))].Why this step? This is exactly a staircase / histogram approximation of f. Set hk=f(midpoint of interval k).
Since f is continuous on a compact set, it is uniformly continuous: shrink the interval width and every step's height error shrinks below ε. Making w large sharpens each step. So the staircase converges uniformly to f. ■ (intuitive version)
What does the Universal Approximation Theorem guarantee?
A single-hidden-layer network with enough neurons can uniformly approximate any continuous function on a compact set to arbitrary accuracy ε.
The theorem is an ___ result, not an efficiency result.
existence.
Which activations make a shallow net universal (Leshno)?
Any non-polynomial activation (sigmoid, tanh, ReLU...).
How do you build a "bump" from sigmoids?
Subtract two sharp sigmoid steps: σ(w(x−b1))−σ(w(x−b2)).
What does ReLU(x) - ReLU(x-δ) actually produce?
A ramp that rises over [0,δ] and plateaus at height δ — NOT a localized bump; a true bump needs more ReLU units.
Why does compactness matter in the proof?
It gives uniform continuity, so a fine enough staircase of bumps is everywhere within ε.
Neurons needed for M bumps in 1-D (sigmoids)?
N=2M (two sigmoids per bump).
Why do we still use deep networks if one layer is universal?
Depth achieves the same functions with exponentially fewer neurons and is easier to train; width alone can blow up.
Does the theorem promise good generalization?
No — only fitting on the domain given ideal weights; generalization is separate.
Give an example where the theorem does NOT apply.
1/x on (0,1] — domain not compact and function unbounded.
Recall Feynman: explain to a 12-year-old
Imagine you want to draw any wiggly line. You have a stamp that makes one small rectangular block. If you stack lots of blocks of different heights side by side, you can trace out any shape, like Lego steps forming a curve. A neuron makes one "on/off" edge; two neurons make one block; many neurons make many blocks. So with enough blocks you can copy any smooth line. The catch: sometimes you'd need a huge pile of blocks — that's why real networks stack layers to be clever instead of just piling millions of blocks.
Universal Approximation Theorem ka core idea bahut simple hai: agar tumhare paas ek hi hidden layer wala neural network hai, lekin usme kaafi saare neurons hain, to woh kisi bhi continuous function ko (jo bounded, closed region par defined ho) itna accurately copy kar sakta hai jitna tum chaho — error ε ko as small as you like rakh sakte ho. Yaani "any shape" banana possible hai.
Kaise? Socho ek sigmoid ek "soft step" banata hai — 0 se 1 tak jump. Do sigmoids ko subtract karo to ek chhota "bump" (rectangle) ban jata hai. Ab aise bahut saare bumps ko alag-alag heights par jodo, to ek staircase ban jati hai jo tumhare target curve ko trace kar leti hai. Function continuous aur domain compact hone ki wajah se uniform continuity milti hai — matlab agar bumps chhote karte jao to error har jagah kam hota jata hai. Yehi proof ka asli engine hai. (Chhoti si baat: ReLU ke saath do units subtract karne se ek ramp milta hai jo δ par plateau kar jata hai, poora rectangular bump nahi — bump ke liye thode aur ReLU units chahiye, lekin universality phir bhi hold karti hai.)
Ek important baat yaad rakhna: yeh theorem sirf existence batata hai, efficiency nahi. Matlab solution exist karta hai, lekin uske liye neurons ki sankhya exponentially badi ho sakti hai, aur gradient descent se woh weights milna guarantee nahi. Isiliye practically hum deep networks use karte hain — kam neurons me kaam ho jata hai aur training easy hoti hai.
Aur ek common galti: "universal" ka matlab yeh nahi ki network unseen data par bhi perfect predict karega. Theorem sirf training domain par fitting ke baare me hai — generalization ek alag topic hai (overfitting, regularization wagairah). Bas yaad rakho: BUMPS BUILD BUILDINGS, aur do keys — Compact domain + Continuous function.