ElemedexA pocket encyclopedia of AI architectures

Glossary (TM) › Machine learning fundamentals

TM001

Activation function

Also: ReLU, sigmoid, step function

In Spanish: Función de activación

The nonlinear function each unit applies to its weighted sum; without it, a many-layered network would amount to a single linear transformation.

Three functions mark the history:

Why is it needed? Because a composition of linear functions is linear. If each layer merely multiplied by a matrix and added a vector, stacking ten layers would be the same as having one: a "deep" network without activations would be a linear model in disguise (Chollet, 2021, sec. 2.3.5). Nonlinearity is what enlarges the hypothesis space and gives depth its point (Chollet, 2021, sec. 4.1.3). The classic example is XOR: no straight line separates its positive cases from its negative ones, so no linear classifier can compute it; with a nonlinear hidden layer, it can be done (Witten et al., 2017, p. 262).

At the network's output, activations are chosen by task: sigmoid for a binary probability, softmax for a distribution over many classes, none for regression.

A note for logicians: the step function makes each unit a small truth function, and in that sense the first networks were hard-wired logic. By smoothing the step in order to differentiate, networks traded bivalence for degrees: what they gained in learnability they lost in immediate legibility. You can compare both in the perceptron lab.

Sources

  • Chollet, F. (2021). Deep learning with Python (2nd ed.). Manning Publications. §
  • Witten, I. H., Frank, E., Hall, M. A., & Pal, C. J. (2017). Data mining: Practical machine learning tools and techniques (4th ed.). Morgan Kaufmann. https://doi.org/10.1016/C2015-0-02071-8 §