🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
Search courses…
💼 Servicesℹ️ About✉️ ContactView Pricing Plansfrom $10

Activation Functions — Sigmoid, ReLU, GELU and The Dead Neuron Problem

FoundationsArchitecture🟢 Free Lesson

Advertisement

DL Foundations

Activation Functions — Adding Non-Linearity to Neural Networks

Without activation functions, deep networks collapse into linear models no matter how many layers are stacked. Activation functions introduce the non-linearity that enables learning of arbitrary decision boundaries.

  • ReLU is the Default — Fast, prevents vanishing gradients, provides sparse activations for hidden layers
  • GELU for Transformers — Smooth approximation to ReLU used in BERT, GPT, and Vision Transformers
  • Dead Neuron Problem — ReLU neurons that always output zero require careful initialization and architecture choices

Activation Functions — Sigmoid, ReLU, GELU and The Dead Neuron Problem

Activation functions introduce non-linearity into neural networks, enabling them to learn complex patterns. Without them, a deep network would collapse into a linear model.


Why Activation Functions?

Without Activation Functions: Linear CollapseInputLinearW₁xLinearW₂(W₁x)LinearW₃(W₂W₁x)= W'xSingle linear!W₃ · W₂ · W₁ · x = W' · x (equivalent to single layer)

Sigmoid


Tanh


Activation Function Comparison

Activation Functions: Shape and Derivative ComparisonxySigmoidTanhReLUFunction Shapexy'σ' (max 0.25)tanh' (max 1.0)ReLU' (0 or 1)Derivative Shape

ReLU and Variants


GELU and Swish

Modern Activation Functions: GELU and SwishReLUGELUSwishxyGELU: Smooth ReLU approximationUsed in: BERT, GPT, ViT

Softmax


When to Use Each Activation

Activation Function Selection GuideHidden LayersReLU (default)GELU (transformers)Swish (deep nets)Leaky ReLU (avoid dead neurons)Output LayerSoftmax (multi-class)Sigmoid (binary)None (regression)Multi-hot (multi-label)Special CasesMish (self-regularizing)Hardswish (mobile)PReLU (learned α)CELU (smooth ELU)

The Dead Neuron Problem


Summary

  • Activation functions introduce non-linearity, enabling deep networks to learn complex patterns
  • ReLU is the default for hidden layers: fast, prevents vanishing gradients, but causes dead neurons
  • GELU/Swish are preferred for transformers and deep networks: smooth, self-gated
  • Softmax for multi-class output, Sigmoid for binary output, None for regression
  • Dead neurons are a practical concern with ReLU; use Leaky ReLU or careful initialization to mitigate

Next: Loss Functions for Deep Learning

Need Expert Deep Learning Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement