An activation function transforms a neuron's weighted input, bias, and threshold into its output, allowing neural-network units to fire nonlinearly. section 9.7
Common activation-function choices include:
- Sign, step, tanh, arctan, logistic sigmoid, softmax, radial basis function, and ReLU. section 9.7
- The chosen function operates within a forward pass whose parameters are optimized against a loss or cost function. section 9.7
Tanh in a neural-network forward pass
A NumPy implementation computes the hidden pre-activation as z1 = X.dot(W1) + b1, then applies a1 = np.tanh(z1) before producing output logits.













