Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.A function that grows at its own size
Some quantities grow faster the bigger they get: a bacteria colony, a snowball rolling downhill, money earning interest on interest. The special function grows at a rate exactly equal to its current size. That one fact makes it the star of calculus.
The squashing function
Neural networks use an S-shaped activation function like the sigmoid. It squashes any number into the range between 0 and 1, like a dimmer switch. Its slope tells the network how much a small nudge to the input changes the output. If the slope is tiny, learning stalls.
Exponentials describe radioactive decay in a spacecraft’s power source, a battery discharging, and a robot joint’s motion settling to rest. Sines and cosines describe every vibration and orbit. Knowing their slopes lets engineers predict and control all of these.
- 1. If eˣ is 5 at some point, how fast is it growing there?
- 2. What is the sigmoid's output at 0?
- 3. Can the sigmoid ever output more than 1?
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.The essential table
Combine these with the chain rule (A3.1-2): , , and .
- 1. (ln x)′ at x = 4?
- 2. (sin x)′ at 0?
- 3. (e^(3x))′ = ?
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Activation functions and their derivatives
| Activation | max | ||
|---|---|---|---|
| sigmoid | |||
| tanh | 1 | ||
| ReLU | 1 | ||
| softplus | 1 | ||
| SiLU / swish | ≈ 1.1 | ||
| GELU | ≈ 1.13 |
The derivatives are written in terms of the function itself (). Backprop can therefore reuse the value saved in the forward pass, which costs no extra exponentials.
Vanishing gradients
Backprop multiplies one activation derivative per layer (A3.1-2). With the sigmoid, each factor is at most , so 10 layers give at most . This vanishing gradient problem (Hochreiter, 1991; Bengio, Simard and Frasconi, 1994) is why modern deep networks use ReLU-family activations, careful initialization and residual connections.
The logarithmic derivative
It turns products into sums, which is how we differentiate (giving ). In statistics, it is the score function , central to maximum likelihood and policy gradients.
- 1. σ′(0) = ?
- 2. softplus′(x) equals…
- 3. If tanh x = 0.6, then tanh′(x) = ?
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Where the formulas come from
Exponential. , because . That limit is one way to define .
Sine. , using the two limits from A3.1-1.
Logarithm. is the inverse of . By the inverse-function rule, .
Sigmoid. , so .
tanh. , so .
Uniqueness of the exponential
The only differentiable with and is .
Proof. Let . Then , so is constant (by the mean value theorem, A3.1-4), and . ∎ This is why solves every linear ODE , the scalar case of A2.4-3.
Exercise 3.1: Differentiate xˣ
Let , so . Differentiating gives , so . At , this is .
- 1. (eˣ)′ = eˣ follows from which limit?
- 2. (xˣ)′ at x = 1?
- 3. (arctan x)′ at x = 1?
Level 4: Expert
★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.Depth, derivatives and trainability
- Activation design. ReLU fixed the vanishing derivative for positive inputs (Nair and Hinton, 2010; Glorot, Bordes and Bengio, 2011), but has “dead” units with derivative 0. Smooth variants (softplus, SiLU/swish, GELU; Hendrycks and Gimpel, 2016; Ramachandran, Zoph and Le, 2017) keep nonzero gradients, and GELU/SiLU are standard in transformers.
- Initialization. Xavier/Glorot (2010) and He et al. (2015) choose weight scales so that, combined with the activation derivative, signal and gradient norms stay roughly constant through depth. Exercise 2 shows this with He-initialized ReLU.
- Numerical stability. overflows for large , and overflows in the sigmoid for very negative . Libraries use
log1p,exp(-|x|)and the log-sum-exp trick (Practice Code 4). Softmax followed by cross-entropy has the beautifully simple gradient (Practice Code 3). - The log-derivative trick in robot learning. (REINFORCE; Williams, 1992). It lets a robot improve a policy from rewards alone, even when the reward (task success) can’t be differentiated. The price is high variance (Practice Code 5), which motivates baselines, actor-critic methods and PPO.
References
- L. Euler (1748). Introductio in analysin infinitorum. (The exponential and its series.)
- S. Hochreiter (1991). Untersuchungen zu dynamischen neuronalen Netzen. Diploma thesis, TU München.
- Y. Bengio, P. Simard, P. Frasconi (1994). “Learning long-term dependencies with gradient descent is difficult.” IEEE Transactions on Neural Networks, 5(2).
- R. Williams (1992). “Simple statistical gradient-following algorithms for connectionist reinforcement learning.” Machine Learning, 8.
- X. Glorot, Y. Bengio (2010). “Understanding the difficulty of training deep feedforward neural networks.” AISTATS.
- V. Nair, G. Hinton (2010). “Rectified linear units improve restricted Boltzmann machines.” ICML.
- K. He, X. Zhang, S. Ren, J. Sun (2015). “Delving deep into rectifiers: surpassing human-level performance on ImageNet classification.” ICCV.
- D. Hendrycks, K. Gimpel (2016). “Gaussian error linear units (GELUs).” arXiv:1606.08415.
- P. Ramachandran, B. Zoph, Q. Le (2017). “Searching for activation functions.” arXiv:1710.05941.