Derivatives Of Activation Functions (C1W3L08)

25 Aug 2017 · 8 min
7:57

Lecture (Andrew Ng) describing how to compute derivatives (slopes) of common neural-network activation functions needed for backpropagation. Covers: sigmoid (g'(z)=g(z)(1-g(z)), equivalently a(1-a) when a=g(z)); tanh (g'(z)=1-(tanh z)^2, equivalently 1-a^2 when a=tanh(z)); ReLU (g(z)=max(0,z), g'(z)=0 for z<0, 1 for z>0, undefined at z=0 — subgradient used in practice); leaky ReLU (g(z)=max(0.01z,z), g'(z)=0.01 for z<0, 1 for z>0). Ends with implementation advice for gradient descent.

Questions this video answers

g'(z) = g(z) (1 - g(z)); equivalently, if a = g(z), then g'(z) = a (1 - a).

g'(z) = 1 - (tanh z)^2; equivalently, if a = tanh(z), then g'(z) = 1 - a^2.

g'(z) = 0 for z < 0; g'(z) = 1 for z > 0; technically undefined at z = 0 (a subgradient may be used in practice).

For g(z)=max(0.01z, z): g'(z) = 0.01 for z < 0; g'(z) = 1 for z > 0; technically undefined at z = 0.

Chapters

More from LARRUZ

8:49
youtube.com

OpenAI’s New AI Is Doing Things We Barely Understand

3d ago
5:38
youtube.com

DeepSeek Solved AI’s Memory Problem

5d ago
33:17
youtube.com

DeepMind's New AI Just Cracked The Code Of Life

1w ago
3:43
youtube.com

The Billion Dollar AI Advantage Is Disappearing

1w ago
5:14
youtube.com

Claude Opus 5.5 AI: An Incredible Leap Forward

3w ago
5:16
youtube.com

Yes, Jev Is Insane, But There's A Catch

3w ago
5:11
youtube.com

DeepSeek’s Insane New Architecture

4w ago
4:16
youtube.com

Claude Is Now Leaving Invisible Fingerprints In Its Text

1mo ago
9:18
youtube.com

I Never Thought I’d See This Happen

1mo ago
5:22
youtube.com

GPT-6 Astra Changes Everything

1mo ago
4:55
youtube.com

Claude Fable AI Is Much Stranger Than The Headlines Suggest

1mo ago
See all content