SlideShare a Scribd company logo
Backprop
Avilay Parekh (Machine Learning Engineer)
@avilay
What is backprop?
It is an algorithm to calculate the derivatives of variables in equations.
Given: 𝑦 = 𝑓 𝑥
It outputs:
𝑑𝑦
𝑑𝑥
Most useful for complicated tensor equations like the ones we see in
Neural Nets.
3-Part Video Mini-Series
1. Understand Compute Graphs
2. Backprop of a simple equation with Pytorch
3. Backprop of a more complicated equation with Pytorch
Objective: You are able apply the backprop algorithm to any equation
to compute its gradients.
Compute Graphs
Different ways to draw the compute graphs for the following equations:
𝑦 = 𝑥 + 2
𝑦 = (𝑥 + 2)2
𝑦 = 3(𝑥 + 2)2
𝑦 =
5𝑥2
1 + 𝑒 𝑥
Backprop
Different ways to compute gradients for the following equations:
𝑦 = 3(𝑥 + 2)2
𝑦 =
5𝑥2
1 + 𝑒 𝑥
Backprop
Backprop
Backprop
Backprop

More Related Content

What's hot

GRAPHICAL STRUCTURES in our lives
GRAPHICAL STRUCTURES in our livesGRAPHICAL STRUCTURES in our lives
GRAPHICAL STRUCTURES in our lives
xryuseix
 
matab no4
matab no4matab no4
2-Rainbow Domination of Hexagonal Mesh Networks
2-Rainbow Domination of Hexagonal Mesh Networks2-Rainbow Domination of Hexagonal Mesh Networks
2-Rainbow Domination of Hexagonal Mesh Networks
ijcoa
 
Comparing two electric motors tmid
Comparing two electric motors   tmidComparing two electric motors   tmid
Comparing two electric motors tmid
Teresa Middleton
 
Parallel computing homework help
Parallel computing homework helpParallel computing homework help
Parallel computing homework help
Assignmentpedia
 
Big o notation
Big o notationBig o notation
Big o notation
keb97
 
Matrix multiplicationdesign
Matrix multiplicationdesignMatrix multiplicationdesign
Matrix multiplicationdesign
Respa Peter
 
Minimum Spanning Tree using Kruskal's Algorithm
Minimum Spanning Tree using Kruskal's Algorithm Minimum Spanning Tree using Kruskal's Algorithm
Minimum Spanning Tree using Kruskal's Algorithm
Mrunal Patil
 
Aplicaciones de la derivada
Aplicaciones de la derivadaAplicaciones de la derivada
Aplicaciones de la derivada
JOELSEBASTIANANDRADE
 
Aplicaciones de la derivada
Aplicaciones de la derivadaAplicaciones de la derivada
Aplicaciones de la derivada
JOELSEBASTIANANDRADE
 
Python Programming Essentials - M23 - datetime module
Python Programming Essentials - M23 - datetime modulePython Programming Essentials - M23 - datetime module
Python Programming Essentials - M23 - datetime module
P3 InfoTech Solutions Pvt. Ltd.
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
M. Raihan
 
Applied maths for electronics engineers jan 2013 (1)
Applied maths for electronics engineers jan 2013 (1)Applied maths for electronics engineers jan 2013 (1)
Applied maths for electronics engineers jan 2013 (1)
SRI TECHNOLOGICAL SOLUTIONS
 
Big o notation
Big o notationBig o notation
Big o notation
hamza mushtaq
 
Kinematic Synthesis of Four Bar Mechanism using Function Generator
Kinematic Synthesis of Four Bar Mechanism using Function GeneratorKinematic Synthesis of Four Bar Mechanism using Function Generator
Kinematic Synthesis of Four Bar Mechanism using Function Generator
IJERA Editor
 
Applications of linear algebra in computer science
Applications of linear algebra in computer scienceApplications of linear algebra in computer science
Applications of linear algebra in computer science
Arnob Khan
 
KRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitraKRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitra
guest1f4fb3
 
Energy of Some Simple Graphs: MATLAB Approach
Energy of Some Simple Graphs: MATLAB ApproachEnergy of Some Simple Graphs: MATLAB Approach
Energy of Some Simple Graphs: MATLAB Approach
IJCSIS Research Publications
 
Curve Fitting - Linear Algebra
Curve Fitting - Linear AlgebraCurve Fitting - Linear Algebra
Curve Fitting - Linear Algebra
Gowtham Cr
 
matlab 10
matlab 10matlab 10

What's hot (20)

GRAPHICAL STRUCTURES in our lives
GRAPHICAL STRUCTURES in our livesGRAPHICAL STRUCTURES in our lives
GRAPHICAL STRUCTURES in our lives
 
matab no4
matab no4matab no4
matab no4
 
2-Rainbow Domination of Hexagonal Mesh Networks
2-Rainbow Domination of Hexagonal Mesh Networks2-Rainbow Domination of Hexagonal Mesh Networks
2-Rainbow Domination of Hexagonal Mesh Networks
 
Comparing two electric motors tmid
Comparing two electric motors   tmidComparing two electric motors   tmid
Comparing two electric motors tmid
 
Parallel computing homework help
Parallel computing homework helpParallel computing homework help
Parallel computing homework help
 
Big o notation
Big o notationBig o notation
Big o notation
 
Matrix multiplicationdesign
Matrix multiplicationdesignMatrix multiplicationdesign
Matrix multiplicationdesign
 
Minimum Spanning Tree using Kruskal's Algorithm
Minimum Spanning Tree using Kruskal's Algorithm Minimum Spanning Tree using Kruskal's Algorithm
Minimum Spanning Tree using Kruskal's Algorithm
 
Aplicaciones de la derivada
Aplicaciones de la derivadaAplicaciones de la derivada
Aplicaciones de la derivada
 
Aplicaciones de la derivada
Aplicaciones de la derivadaAplicaciones de la derivada
Aplicaciones de la derivada
 
Python Programming Essentials - M23 - datetime module
Python Programming Essentials - M23 - datetime modulePython Programming Essentials - M23 - datetime module
Python Programming Essentials - M23 - datetime module
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 
Applied maths for electronics engineers jan 2013 (1)
Applied maths for electronics engineers jan 2013 (1)Applied maths for electronics engineers jan 2013 (1)
Applied maths for electronics engineers jan 2013 (1)
 
Big o notation
Big o notationBig o notation
Big o notation
 
Kinematic Synthesis of Four Bar Mechanism using Function Generator
Kinematic Synthesis of Four Bar Mechanism using Function GeneratorKinematic Synthesis of Four Bar Mechanism using Function Generator
Kinematic Synthesis of Four Bar Mechanism using Function Generator
 
Applications of linear algebra in computer science
Applications of linear algebra in computer scienceApplications of linear algebra in computer science
Applications of linear algebra in computer science
 
KRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitraKRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitra
 
Energy of Some Simple Graphs: MATLAB Approach
Energy of Some Simple Graphs: MATLAB ApproachEnergy of Some Simple Graphs: MATLAB Approach
Energy of Some Simple Graphs: MATLAB Approach
 
Curve Fitting - Linear Algebra
Curve Fitting - Linear AlgebraCurve Fitting - Linear Algebra
Curve Fitting - Linear Algebra
 
matlab 10
matlab 10matlab 10
matlab 10
 

More from Avilay Parekh

Ai & ml
Ai & mlAi & ml
Ai & ml
Avilay Parekh
 
Pupymeetup
PupymeetupPupymeetup
Pupymeetup
Avilay Parekh
 
Day4
Day4Day4
Day3
Day3Day3
Day2
Day2Day2
Day1
Day1Day1
Git primer
Git primerGit primer
Git primer
Avilay Parekh
 
Git undo
Git undoGit undo
Git undo
Avilay Parekh
 
Ruby object graph
Ruby object graphRuby object graph
Ruby object graph
Avilay Parekh
 
What is cloud computing
What is cloud computingWhat is cloud computing
What is cloud computing
Avilay Parekh
 

More from Avilay Parekh (10)

Ai & ml
Ai & mlAi & ml
Ai & ml
 
Pupymeetup
PupymeetupPupymeetup
Pupymeetup
 
Day4
Day4Day4
Day4
 
Day3
Day3Day3
Day3
 
Day2
Day2Day2
Day2
 
Day1
Day1Day1
Day1
 
Git primer
Git primerGit primer
Git primer
 
Git undo
Git undoGit undo
Git undo
 
Ruby object graph
Ruby object graphRuby object graph
Ruby object graph
 
What is cloud computing
What is cloud computingWhat is cloud computing
What is cloud computing
 

Recently uploaded

Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 

Recently uploaded (20)

Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 

Backprop

  • 1. Backprop Avilay Parekh (Machine Learning Engineer) @avilay
  • 2. What is backprop? It is an algorithm to calculate the derivatives of variables in equations. Given: 𝑦 = 𝑓 𝑥 It outputs: 𝑑𝑦 𝑑𝑥 Most useful for complicated tensor equations like the ones we see in Neural Nets.
  • 3. 3-Part Video Mini-Series 1. Understand Compute Graphs 2. Backprop of a simple equation with Pytorch 3. Backprop of a more complicated equation with Pytorch Objective: You are able apply the backprop algorithm to any equation to compute its gradients.
  • 4. Compute Graphs Different ways to draw the compute graphs for the following equations: 𝑦 = 𝑥 + 2 𝑦 = (𝑥 + 2)2 𝑦 = 3(𝑥 + 2)2 𝑦 = 5𝑥2 1 + 𝑒 𝑥
  • 5.
  • 6.
  • 7.
  • 8. Backprop Different ways to compute gradients for the following equations: 𝑦 = 3(𝑥 + 2)2 𝑦 = 5𝑥2 1 + 𝑒 𝑥

Editor's Notes

  1. Welcome! My name is Avilay. I am a Machine Learning engineering based out of Seattle. You can follow me on Twitter @avilay. In this video mini-series we will cover the back prop algorithm.
  2. So what is Backprop anyway? It is an algorithm used to calculate derivatives. Put simply, given an equation y equals f of x, backprop gives us the derivative of y w.r.t x. Now, of course if y depends on multiple variables we can calculate the partial derivative of y w.r.t x and so on, but you get the idea. Most of us learnt things like the chain rule and the product rule for calculating derivatives in high school. But if we were to try and apply it to really really complicated equations involving multi dimensional tensors it can be pretty tedious. Not to mention hard to get right. But these are the kind of equations we see in Neural Nets. And this is where Backprop shines.
  3. In this 3 part series the first video will cover how to create compute graphs. We will go through the exercise of creating compute graphs of various equations by hand. In the second part, we will work through the Backprop algo to calculate the gradients of a simple equation. We will also see how the Pytorch APIs make it very easy for us to do this. In the third video we’ll do the same thing, but with a more complicated equation. After these three videos, you should be able to decompose any equation into its compute graph and apply the backprop algo to compute its gradients. See you in the next video!