Skip to content

Activation Functions

For people

What activation functions do in neural networks, and the strengths of ReLU, sigmoid, tanh, GELU and softmax.

Editorial team 1 min read

Share X LinkedIn Reddit Bluesky Email

Activation functions introduce non-linearity into neural networks. Without them, a deep network would behave like a single linear model.

Common Functions

  • ReLU: outputs the input if positive, otherwise zero. Simple, fast and widely used in hidden layers.
  • Leaky ReLU: like ReLU but with a small slope for negative inputs, avoiding "dead" units that never activate.
  • GELU and SiLU (Swish): smooth alternatives common in transformers and modern architectures.
  • Sigmoid: squashes values to 0–1. Used for binary outputs and gates; prone to vanishing gradients in deep hidden layers.
  • Tanh: squashes values to −1 to 1; zero-centred.
  • Softmax: turns a vector of scores into probabilities summing to 1, for multi-class outputs.

Choosing

  • Hidden layers: ReLU or GELU-family functions are safe defaults.
  • Binary or multi-label outputs: sigmoid.
  • Multi-class outputs: softmax.
  • Regression outputs: usually no activation (linear).

Vanishing Gradients

Functions that saturate, like sigmoid, produce tiny gradients, slowing learning in deep networks — a key reason ReLU-family functions became standard.

More in Machine learning

All Machine learning guides →
Machine learning Guide · 2 min

Linear Regression Explained

The simplest predictive model: how linear regression fits a line through data, how to read its coefficients, and when it breaks down.

Machine learning 2 min read 25 Sep 2026 For people

Machine learning Guide · 2 min

Logistic Regression for Classification

Despite its name, logistic regression is a classification method. How it produces probabilities and why it remains a strong baseline.

Machine learning 2 min read 24 Sep 2026 For people

Machine learning Guide · 2 min

Decision Trees

How decision trees split data with simple questions, why they are easy to explain, and why single trees overfit.

Machine learning 2 min read 23 Sep 2026 For people

Machine learning Guide · 2 min

Random Forests

Why averaging many randomised decision trees produces a robust, accurate model with little tuning.

Machine learning 2 min read 22 Sep 2026 For people

Discussion 0

Use @handle to bring somebody in, and #tag to file it.

Nothing here yet. Ask a question, or say how you used it.

Sign in to join the discussion. Sign in