

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Activation functions introduce non-linearities into neural networks, enabling them to
approximate complex patterns and functions in the data. Without activation functions, neural
networks would behave as linear models, limiting their ability to solve non-linear problems,
which are common in real-world applications. The choice of activation function affects the
training dynamics, convergence speed, and performance of the neural network.
o Formula: 𝜎(𝑥) =
ଵ
ଵା
షೣ
o Range: (0, 1)
o Characteristics: Produces outputs between 0 and 1, useful for binary
classification.
o Advantages:
Useful in binary classification tasks.
Smooth gradient, making optimization easier.
o Limitations:
Vanishing Gradient Problem: Gradients become very small for large
positive or negative values, slowing down training.
Outputs are not zero-centered, causing inefficiencies during
optimization.
o Formula: 𝑡𝑎𝑛 ℎ(𝑥) =
ೣ
ି
షೣ
ೣ
ା
షೣ
o Range: (-1, 1)
o Characteristics: Produces outputs between -1 and 1, which centers the data.
o Advantages:
Zero-centered output helps in faster convergence.
Stronger gradient than sigmoid, making it suitable for hidden layers.
o Limitations:
Suffers from the vanishing gradient problem for large positive or
negative inputs.
o Formula: f(x)=max(0,x)
o Range: [0, ∞)
o Characteristics: Outputs zero for negative inputs and scales positively for
positive inputs.
o Advantages:
Efficiently addresses vanishing gradient problem for positive inputs.
Computationally efficient and widely used in deep networks.
o Limitations:
Dying ReLU Problem: Neurons can become inactive if they output
zero for all inputs, causing them to never learn (gradient remains zero).
o Formula: 𝑓(𝑥) = 𝑥; 𝑖𝑓 𝑥 ≥ 0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 𝑓(𝑥) = 𝛼𝑥 (where α is a small
constant, typically 0.01)
o Range: (-∞, ∞)
o Characteristics: Allows a small, non-zero gradient for negative inputs, unlike
ReLU.
o Advantages:
Solves the “dying ReLU” problem by allowing a small gradient for
negative inputs.
o Limitations:
The choice of the parameter α\alphaα is arbitrary and may need tuning.
o Formula: S𝑜𝑓𝑡𝑚𝑎𝑥
ೣ
∑
ೣ
ೕ
ೕ
o Range: (0, 1), with outputs summing to 1
o Characteristics: Converts output to a probability distribution, useful for
multi-class classification.
o Advantages:
Produces interpretable probabilities for each class.
o Limitations:
Not suitable for hidden layers due to high computational complexity.
Activation
Function
Advantages Limitations
Sigmoid
Good for binary outputs, smooth
gradient
Vanishing gradient, not zero-
centered
Tanh Zero-centered, stronger gradient
Vanishing gradient for large
inputs
ReLU Simple, computationally efficient Dying ReLU problem
Leaky ReLU Solves dying ReLU
Requires hyperparameter
tuning
Softmax
Converts to probability, useful for
classification
High computational cost
Sigmoid and Tanh: Often used in shallow neural networks and in final layers for
binary classification.
ReLU and Variants (Leaky ReLU, PReLU, ELU): Commonly used in deep
convolutional networks and in hidden layers to handle complex patterns.
Softmax: Used in the final layer of a network for multi-class classification.
Shallow Networks: Sigmoid and Tanh are more prevalent but less common in deep
networks due to vanishing gradient issues.