Table of Contents
Activation functions are essential components of neural networks. They determine whether a neuron should be activated or not, influencing the network’s ability to learn complex patterns. Understanding how these functions work and how to compute them is fundamental in neural network design.
What Are Activation Functions?
Activation functions introduce non-linearity into the network. Without them, the neural network would behave like a linear model, limiting its capacity to solve complex problems. They transform the input signals into output signals that can be passed to subsequent layers.
Common Activation Functions
- Sigmoid: Outputs values between 0 and 1, useful for probability estimation.
- ReLU: Outputs the input directly if positive; otherwise, zero. It is computationally efficient and helps mitigate vanishing gradients.
- Tanh: Outputs values between -1 and 1, centered around zero, which can improve training dynamics.
Computing Activation Functions
Each activation function has a mathematical formula used to compute its output from the input. For example:
Sigmoid:
f(x) = 1 / (1 + e-x)
ReLU:
f(x) = max(0, x)
Tanh:
f(x) = (ex – e-x) / (ex + e-x)