Activation function
Components — The Working PartsThe element-wise nonlinearity applied after the weighted sum; determines what inputs a neuron responds to and enables the network to represent non-linear functions.
An activation function applies a fixed, element-wise nonlinear transformation to the pre-activation (weighted sum + bias) of each neuron: a = activation(z). Without nonlinearity, any stack of linear layers collapses to a single linear transformation — the activation is what makes depth meaningful. Key choices: sigmoid σ(z) = 1/(1+e^{-z}), squashes to (0,1), saturates in tails (vanishing gradient risk); tanh(z), zero-centered sigmoid, same saturation risk; ReLU max(0,z), the modern default — simple, gradient-preserving for z>0 but causes dead neurons for z≤0 (dead-relu problem); softmax (output layer for classification), converts logits to a probability distribution. The choice of activation directly determines gradient flow: ReLU's linear-for-positive region is why it enables deep networks that sigmoid cannot.