
Understanding Backpropagation: A Comprehensive Overview
Dive into the world of backpropagation with this detailed guide covering concepts like gradient descent, chain rule, forward pass, and backward pass in neural networks. Learn how to efficiently compute gradients and optimize network parameters for effective machine learning models.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Backpropagation Hung-yi Lee
Gradient Descent = , , , , , w w b b Network parameters 1 2 1 2 Starting Parameters 0 1 2 ( ) L ( ) ( ) ( ) ( ) L = 1 0 0 0 L C L ompute ( ) ( ) L w 1 = 2 1 1 1 L C L ompute w 2 = ( ) ( ) L b Millions of parameters 1 L b To compute the gradients efficiently, we use backpropagation. 2
Chain Rule ( ) x ( ) y y = z = g h Case 1 dz= dz dy x y z dx dy dx Case 2 ( ) y ( ) s ( ) s = y = x = , z k x h g x dz z dx z dy s z = + ds x ds y ds y
NN ? Backpropagation ?? xn yn ?? ? ? ???? ?? ?? ? ?? ??? ? ? = = ?=1 ?=1 ?1 ?1 ?2 ?2
Backpropagation ? ?1 + ?1 ?1 b ?2 ? = ?1?1+ ?2?2+ ? ?2 ?2 Forward pass: ?? ?? for all parameters Compute ?? ??=? ?? ?? ?? ?? Backward pass: ?? ?? for all activation Compute function inputs z (Chain rule)
Backpropagation Forward pass ?? ?? for all parameters Compute ? ?1 + ?1 ?1 b ?2 ? = ?1?1+ ?2?2+ ? ?2 ?2 ?? ??1=? ?1 The value of the input connected by the weight ?? ??2=? ?2
Backpropagation Forward pass ?? ?? for all parameters Compute 0.98 0.86 2 3 1 1 -1 -1 -2 -2 0 1 -2 -1 -1 0.12 0.11 -1 -1 4 1 0 2 0 ?? ??= 0.11 ?? ??= 0.12 ?? ??= 1
Backpropagation Backward pass ?? ?? for all activation function inputs z Compute ? ? ?1 + ?1 ? = ? ? b ?2 ?2 ? ? ?? ??=?? ?? ?? ?? ? ? ? ?
Backpropagation Backward pass ?? ?? for all activation function inputs z Compute ? ? ? ?3 ?1 + + ?1 ? = ??3+ ? = ? ? b ?2 ?4 ? + ?2 ?? ??=?? ?? ?? +?? ? ?? ?? (Chain rule) ? ?? ??=?? ?? ?? ?? ?? ?? Assumed it s known ?3 ?4
Backpropagation Backward pass ?? ?? for all activation function inputs z Compute ? ? ? ?3 ?1 + + ?1 ?? ?? ?? ?? b ?2 ?4 ? + ?2 ?? ?? ?? ??= ? ? ?? ?? + ?4 ?? ?? ?3
Backpropagation Backward pass ? ? ?3 + ?? ?? ?? ?? ?4 + ? ? is a constant because z is already determined in the forward pass. ?? ?? ?? ??= ? ? ?? ?? + ?4 ?? ?? ?3
Backpropagation Backward pass ?? ?? for all activation function inputs z Compute ? ? ? ?3 ?1 + ?1 + ?1 ?? ?? ?? ?? b ?2 ?4 ? + ?2 ?2 Case 1. Output Layer ?? ?? ?? ?? =??1 ?? ??1 ?? ?? =??2 ?? ??2 Done! ?? ??
Backpropagation Backward pass ?? ?? for all activation function inputs z Compute Case 2. Not Output Layer ? + ?? ?? ? + ?? ??
Backpropagation Backward pass ?? ?? for all activation function inputs z Compute Case 2. Not Output Layer ? ? ?? ?? ??? ?5 + + ?? ?? ?6 ?? ? + + ?? ?? ?? ???
Backpropagation Backward pass ?? ?? for all activation function inputs z Compute Case 2. Not Output Layer ?? ?? Compute recursively ? ? ?? ?? ??? ?5 + + ?? ?? ? ? Until we reach the output layer ?6 ?? ? + + ?? ?? ?? ???
Backpropagation Backward Pass ?? ?? for all activation function inputs z Compute ?? ?? from the output layer ?? ??1 Compute ?? ??5 ?? ??3 ?1 ?5 ?3 ?1 ?1 ?2 ?2 ?6 ?? ??6 ?2 ?? ??2 ?4 ?? ??4
Backpropagation Backward Pass ?? ?? for all activation function inputs z Compute ?? ?? from the output layer ?? ??1 Compute ?? ??5 ?? ??3 ?1 ?5 ?3 ?1 ?1 ? ?1 ? ?2 ? ?3 ? ?4 ?2 ?2 ?6 ?? ??6 ?2 ?? ??2 ?4 ?? ??4
Backpropagation Summary Backward Pass Forward Pass ? =?? ?? for all w ?? ?? ?? ?? X = ?