TGViewer
Artificial Intelligence Artificial Intelligence @machinelearning_deeplearning · 56.3K subscribers
Post #1741 5.53K
✅ Deep Learning: Part 3 – Activation Functions Explained 🔌📈

Activation functions decide whether a neuron should "fire" and introduce non-linearity into the model — crucial for learning complex patterns.

1️⃣ Why We Need Activation Functions
Without them, neural networks are just linear regressors.
They help networks learn curves, edges, and non-linear boundaries.

2️⃣ Common Activation Functions

a) ReLU (Rectified Linear Unit)
f(x) = max(0, x)
✔️ Fast
✔️ Prevents vanishing gradients
❌ Can "die" (output 0 for all inputs if weights go bad)

b) Sigmoid
f(x) = 1 / (1 + exp(-x))
✔️ Good for binary output
❌ Causes vanishing gradient
❌ Not zero-centered

c) Tanh (Hyperbolic Tangent)
f(x) = (exp(x) - exp(-x)) / (exp(x) + exp(-x))
✔️ Outputs between -1 and 1
✔️ Zero-centered
❌ Still suffers vanishing gradient

d) Leaky ReLU
f(x) = x if x > 0 else 0.01 * x
✔️ Fixes dying ReLU issue
✔️ Allows small gradient for negative inputs

e) Softmax
Used in final layer for multi-class classification
✔️ Converts outputs into probability distribution
✔️ Sum of outputs = 1

3️⃣ Where to Use What?
• ReLU → Hidden layers (default choice)
• Sigmoid → Output layer for binary classification
• Tanh → Hidden layers (sometimes better than sigmoid)
• Softmax → Final layer for multi-class problems

🧪 Try This:
Build a model with:
• ReLU in hidden layers
• Softmax in output
• Use it for classifying handwritten digits (MNIST)

💬 Tap ❤️ for more!
  • ❤ 8
More from @machinelearning_deeplearning
  1. Sep 22, 2026🚀 Welcome back to our AI Engineer Roadmap! ❤️ In the previous posts, we learned about fun…
  2. Sep 21, 2026🚀 Welcome back to our AI Engineer Roadmap! ❤️ In the previous post, we explored functions…
  3. Sep 20, 2026In the previous post, we learned how conditional statements allow Python programs to make…
  4. Sep 19, 2026In the previous post, we explored Python operators and even tested ourselves with some tri…
  5. Sep 18, 2026In the previous post, we learned how to convert one data type into another using Type Cast…
  6. Sep 17, 2026In the previous post, we learned how to take input from users and display output. One impo…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →