Sunday, 9 November 2025

Deep Learning 02: Activation Functions

 

What’s an Activation Function?

Think of a neuron in a neural network like a little decision-maker.
It receives some numbers (inputs), does math (weighted sum), and then has to decide:

“Should I activate strongly, weakly, or not at all?”

The activation function is the rule it uses to make that decision.


⚙️ Why Do We Need It?

If we didn’t use activation functions, the network would just be doing linear math (straight lines only).
That means:

No matter how many layers we stack, it would still behave like a single straight line → can’t learn complex patterns.

Activation functions add non-linearity, letting the network learn curves, shapes, patterns, etc.


🚦 Common Activation Functions (and how they behave)

FunctionIdeaOutput RangeExample Use
ReLU (Rectified Linear Unit)If input > 0, keep it; else 00 → ∞Most common in hidden layers
SigmoidS-shaped curve; squashes values between 0 and 10 → 1Binary classification outputs
TanhLike sigmoid but between -1 and 1-1 → 1Hidden layers (older networks)
Leaky ReLULike ReLU but allows small slope when input < 0(-∞ → ∞)Fixes “dead neuron” issue

No comments:

Post a Comment

Data Engineering - Client Interview question regarding data collection.

What is the source of data How the data will be extracted from the source What will the data format be? How often should data be collected? ...