Activations, watched training: tanh, sigmoid, softsign, relu

The training demo with a choice of hidden activation. Switch between tanh, sigmoid, softsign and relu and the network, the nonlinearity plot and every histogram follow. Each activation has its own way of zeroing the gradient: tanh goes flat in both tails, sigmoid's slope never exceeds 1/4 and its outputs sit near 0.5 instead of 0, softsign (h/(1+|h|), Glorot & Bengio's best performer) has tanh's shape but tails that flatten only polynomially, and relu is either linear or dead.

Three linked panels: a decision boundary heatmap over the two-moons data, a training loss curve, and either one gradient or activation histogram per hidden layer or a diagram of the network with one node per neuron and one line per weight, updating live as the network trains.
init σ 0.32 depth 6 learning rate 0.60
Everything works as in the training demo (hover and click the boundary to move and pin the probe, hover a node to find it on the nonlinearity plot, and flip the top-right panel between loss and the curve), but the hidden units use the activation you pick. Saturated means the local slope is below 0.01: pinned in a flat tail for tanh and sigmoid (shaded red on the curve), or switched off (h < 0) for relu, shown as off. A relu that is off on some inputs is normal; the readout counts a unit as dead only when it is off on all 120 training points. Switching activation sets the learning rate to its default: 0.6, except 0.2 for relu, which diverges at 0.6 because its slope stays at 1 however large h gets. The slider changes it, even mid-run. The Xavier button sets σ = √(2/(10+10)) ≈ 0.32, Glorot's value, derived assuming the activation is roughly the identity near 0, as tanh is. He (Kaiming He et al., 2015) sets σ = √(2/10) ≈ 0.45, twice the variance, because relu zeroes about half its inputs and so halves the signal's variance at each layer. Things to try: sigmoid at Xavier never leaves chance in 400 steps: its slope is at most 1/4, so each layer shrinks the signal about 4× unless the weights are about 4× larger; drag σ up to 1.3–2.5 (4–8× Xavier) and it trains. relu at depth 8: compare the per-layer σ under the activations view, halving every layer under Xavier but holding steady under He. And each activation at too small and too big. The relu histogram covers [0, 3], with larger values piled into the last bin.