ML0030 Sigmoid

What are the advantages and disadvantages of using a sigmoid activation function?

Answer

The sigmoid activation squashes any real input into the range (0, 1) with a smooth S-curve. Its advantages: it is smooth and differentiable everywhere, and its bounded output has a natural probability interpretation, which keeps it the standard output activation for binary classification and for independent per-label probabilities in multi-label tasks (and for gates in LSTM/GRU cells, which need values in (0,1)). Its disadvantages drove it out of hidden layers: in the tails the function saturates and its derivative (at most 0.25, near zero for most inputs) makes stacked sigmoid layers a prime cause of the vanishing gradient problem; its outputs are not zero-centered, so downstream weight updates are biased in one direction and convergence slows; and the exponential computation is more expensive than ReLU’s simple threshold.

(1) Probability Output: Range (0,1), ideal for binary classification output layers and gating mechanisms.
(2) Vanishing Gradient: Derivative peaks at 0.25 and saturates in the tails; deep stacks lose gradient fast.
(3) Not Zero-Centered: Always-positive outputs bias weight updates and slow convergence; also costlier to compute than ReLU.

Sigmoid curve between zero and one with its derivative peaking at 0.25 and vanishing in the tails

Figure 1: Sigmoid and its derivative \sigma(x)(1-\sigma(x)): a useful probability-shaped output, but the derivative only reaches 0.25 at best and is near zero in both tails: the mechanism behind vanishing gradients.

Mathematical Formulation:
\sigma(x) = \frac{1}{1 + e^{-x}}
\sigma'(x) = \sigma(x)\,\big(1 - \sigma(x)\big) \leq 0.25

Where:

  • x is the neuron’s pre-activation (weighted sum plus bias).
  • \sigma'(x) is the derivative, computed in one line from the output itself, maximal (0.25) at x = 0, approaching 0 as |x| grows.

Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *