SlideShare a Scribd company logo
1 of 65
y
1
y2
y3
x
1
x2
xn
This simple neural network must be trained to recognize
handwritten alphabets ‘a’, ‘b’ and ‘c’
a
b
c
Neural Network
The handwritten alphabets are present as images of 28*28 pixels
y
1
y2
y3
x
1
x2
xn
a
b
c
Neural Network
28
28
The 784 pixels are fed as input to the first layer of our neural
network
y
1
y2
y3
x
1
x2
xn
a
b
c
28*28=784
Neural Network
784
neurons
28
28
The initial prediction is made using the random weights assigned
to each channel
0.3
0.5
0.2
x
1
x2
xn
a
b
c
0.2
0.
8
1.
20.
3
0.
2
0.3
6
0.3
6
1.4
0.9
0.3
28
28*28=784
Neural Network
28
28
Our network predicts the input to be ‘b’ with a probability of 0.5
0.3
0.5
0.2
x
1
x2
xn
a
b
c
0.2
0.
8
1.
20.
3
0.
2
0.3
6
0.3
6
1.4
0.9
0.328*28=784
Neural Network
28
The predicted probabilities are compared against the actual
probabilities and the error is calculated
0.3
0.5
0.2
x
1
x2
xn
a
b
c
0.2
0.
8
1.
20.
3
0.
2
0.3
6
0.3
6
1.4
0.9
0.328*28=784
0.9
0.0
0.0
actual probabilities
+0.6
-0.5
-0.2
error = actual - prediction
Neural Network
28
The magnitude indicates the amount of change while the sign
indicates an increase or decrease in the weights
0.3
0.5
0.2
x
1
x2
xn
a
b
c
0.2
0.
8
1.
20.
3
0.
2
0.3
6
0.3
6
1.4
0.9
0.328*28=784
actual probabilities
error = actual - prediction
Neural Network
0.0
0.0
-0.5
-0.2
28
0.9 +0.6
The information is transmitted back through the network
0.3
0.5
0.2
x
1
x2
xn
a
b
c
0.2
0.
8
1.
20.
3
0.
2
0.3
6
0.3
6
1.4
0.9
0.328*28=784
actual probabilities
error = actual - prediction
Neural Network
0.0
0.0
-0.5
-0.2
28
0.9 +0.6
Weights through out the network are adjusted in order to reduce
the loss in prediction
0.6
0.2
0.0
x
1
x2
xn
a
b
c
28*28=784
actual probabilities
+0.3
-0.2
0.0
error = actual - prediction
0.2
0.
8
1.
20.
3
0.
2
0.3
6
0.3
6
1.4
0.9
0.3
Neural Network
0.0
0.0
28
0.9
a
b
c
28
28
28*28=784
actual probabilities
error = actual - prediction
Neural Network
+0.2
-0.1
0.0
In this manner, we keep training the network with multiple inputs
until it is able to predict with high accuracy
0.7
0.
1
0.0
x
1
x2
xn
0.2
0.
8
1.
20.
3
0.
2
0.3
6
0.3
6
1.4
0.9
0.3
0.0
0.0
0.9
a
b
c
28
28
28*28=784
actual probabilities
error = actual - prediction
Neural Network
0.0
0.0
0.0
In this manner, we keep training the network with multiple inputs
until it is able to predict with high accuracy
0.9
0.
1
0.0
x
1
x2
xn
0.2
0.
8
1.
20.
3
0.
2
0.3
6
0.3
6
1.4
0.9
0.3
0.0
0.0
0.9
28
28
1.0
0.0
1.
0
0.0
0.0
Neural Network
0.0
x
1
x2
xn
a
b
c
28*28=784
actual probabilities
0.0
0.0
0.0
error = actual - prediction
0.4
0.
8
0.
20.
3
0.2
1
0.2
6
0.6
1.0
0.9
1.3
Similarly, our network is trained with the images for ‘b’ and ‘c’ too
Here’s a straightforward dataset. Let’s build a neural network to
predict the outputs, given the inputs
Input Output
0
1
2
3
4
0
6
1
2
1
8
2
4
Example
Input Output
Neural Network
x y
This box
represents our
neural network
x*w
Example
Input Output
Neural Network
x y
‘w’ is the weight
x*w
Example
Input Output
Neural Network
x y
The network starts training
itself by choosing a
random value for w
x*w
Example
Input Output
Neural Network
x y
x*wW=3
Example
Example
Input Output
Neural Network
x y
x*wW=3
Input Output
Neural Network
x y
x*wW=3
Example
Input Output
Neural Network
x y
x*wW=6
Our second model has
w=6
Example
Example
Input Output
Neural Network
x y
x*wW=6
Our second model has
w=6
Input Output
Neural Network
x y
x*wW=6
Example
Input Output
Neural Network
x y
x*wW=9
And finally, our third model
has w=9
Example
Example
Input Output
Neural Network
x y
x*wW=9
And finally, our third model
has w=9
Input Output
Neural Network
x y
x*wW=9
Example
Example
Input Output
Neural Network
x y
x*wW=9
We, as humans, can know just by a look at the data that our weight
should be 6. But how does the machine come to this conclusion?
Loss function
The loss function is a measurement of error which defines the
precision lost on comparing the predicted output to the actual output
loss = [(actual output) – (predicted output)]2
Loss function
Let’s apply the loss
function to input
value “2”
Input Actual Output W=3 W=6 W=9
2 12 6 12 18
---loss (12-6)2 = 36 (12-12)2 = 0 (12-18)2 = 36Los
s
---
Loss function
We now plot a graph
for weight versus loss.
Loss function
This graphical method of
finding the minimum of a
function is called gradient
descent
Gradient descent
A random point on this curve is chosen
and the slope at this point is calculated
Gradient descent
A random point on this curve is chosen
and the slope at this point is calculated
A positive slope indicates an increase in
weight
Gradient descent
This time the slope is negative. Hence,
another random point towards its left is
chosen
A positive slope indicates an increase in
weight
A negative slope indicates a decrease in
weight
Gradient descent
Gradient descent
loss
This time the slope is negative. Hence,
another random point towards its left is
chosen
A positive slope indicates an increase in
weight
A negative slope indicates a decrease in
weight
We continue checking
slopes at various points in
this manner
Our aim is to reach a point where the
slope is zero
A positive slope indicates an increase in
weight
A negative slope indicates a decrease in
weight
A zero slope indicates the appropriate
weight
Gradient descent
Our aim is to reach a point where the
slope is zero
A positive slope indicates an increase in
weight
A negative slope indicates a decrease in
weight
A zero slope indicates the appropriate
weight
Gradient descent
Backpropagation
Backpropagation is the process of updating the weights of the
network in order to reduce the error in prediction
Backpropagation
The magnitude of loss at any point on our graph, combined with
the slope is fed back to the network
backpropagation
Backpropagation
A random point on the graph gives a loss value of 36 with a
positive slope
backpropagation
Backpropagation
A random point on the graph gives a loss value of 36 with a
positive slope
We continue checking
slopes at various points in
this manner
A random point on the graph gives a loss value of 36 with a
positive slope
36 is quite a large number. This means our current weight
needs to change by a large number
A positive slope indicates that the change in weight must
be positive
Backpropagation
A random point on the graph gives a loss value of 36 with a
positive slope
We continue checking
slopes at various points in
this manner
Similarly, another random point on the graph gives a loss value of
10 with a negative slope
10 is a small number. Hence, the weight requires to be
tuned quite less
A negative slope indicates that the weight needs to be
reduced rather than increased
Backpropagation
After multiple iterations of backpropagation, our weights are
assigned the appropriate value
Input Output
x y
x*6
Backpropagation
After multiple iterations of backpropagation, our weights are
assigned the appropriate value
Input Output
x y
x*6
At this point, our network is
trained and can be used to
make predictions
Backpropagation
After multiple iterations of backpropagation, our weights are
assigned the appropriate value
Input Output
x y
x*6
Let’s now get back to our first example and see where backpropagation
and gradient descent fall into place
As mentioned earlier, our predicted output is compared against
the actual output
0.3
0.5
0.2
x
1
x2
xn
a
b
c
0.2
0.
8
1.
20.
3
0.
2
0.3
6
0.3
6
1.4
0.9
0.3
28
28
28*28=784
1.
0
0.0
0.0
actual probabilities
+0.7
-0.5
-0.2
error = actual - prediction
Neural Network
As mentioned earlier, our predicted output is compared against
the actual output
0.3
0.5
0.2
x
1
x2
xn
a
b
c
0.2
0.
8
1.
20.
3
0.
2
0.3
6
0.3
6
1.4
0.9
0.3
28
28
28*28=784
1.
0
0.0
0.0
actual probabilities
error = actual - prediction
Neural Network
+0.7
-0.5
-0.2
loss(a)  0.72 = 0.49
loss(b) 0.52 = 0.25
loss(c)  0.22 = 0.04
1st iteration
Weights through out the network are adjusted in order to reduce
the loss in prediction
0.6
0.2
0.1
x
1
x2
xn
a
b
c
28
28
28*28=784
actual probabilities
+0.4
-0.2
-0.1
error = actual - prediction
0.2
0.
8
1.
30.
3
0.
2
0.3
6
0.3
6
1.4
0.9
0.7
Neural Network
1.
0
0.0
0.0
Weights through out the network are adjusted in order to reduce
the loss in prediction
0.6
0.2
0.1
x
1
x2
xn
a
b
c
28
28
28*28=784
actual probabilities
error = actual - prediction
0.2
0.
8
1.
30.
3
0.
2
0.3
6
0.3
6
1.4
0.9
0.7
Neural Network
1.
0
0.0
0.0
loss(a) 0.72 = 0.49
loss(b) 0.52 = 0.25
loss(c) 0.22 = 0.04
1st iteration 2nd iteration
loss(a) 0.42 = 0.16
loss(b) 0.22 = 0.04
loss(c)  0.12 = 0.01
+0.4
-0.2
-0.1
Weights through out the network are adjusted in order to reduce
the loss in prediction
0.8
0.1
0.1
x
1
x2
xn
a
b
c
28
28
28*28=784
actual probabilities
+0.2
-0.1
-0.1
error = actual - prediction
0.2
0.
2
1.
20.
3
1.
2
0.6
0.3
6
0.4
0.9
0.3
Neural Network
1.
0
0.0
0.0
Weights through out the network are adjusted in order to reduce
the loss in prediction
0.8
0.1
0.1
x
1
x2
xn
a
b
c
28
28
28*28=784
actual probabilities
error = actual - prediction
0.2
0.
2
1.
20.
3
1.
2
0.6
0.3
6
0.4
0.9
0.3
Neural Network
1.
0
0.0
0.0
loss(a) 0.72 = 0.49
loss(b) 0.52 = 0.25
loss(c) 0.22 = 0.04
1st iteration 2nd iteration
loss(a) 0.42 = 0.16
loss(b) 0.22 =
0.04
loss(c) 0.12 = 0.01
+0.2
-0.1
-0.1
3rd iteration
loss(a) 0.22 = 0.04
loss(b) 0.12 =
0.01
loss(c) 0.12 =
0.01
Weights through out the network are adjusted in order to reduce
the loss in prediction
0.8
0.1
0.1
x
1
x2
xn
a
b
c
28
28
28*28=784
actual probabilities
error = actual - prediction
0.2
0.
2
1.
20.
3
1.
2
0.6
0.3
6
0.4
0.9
0.3
Neural Network
1.
0
0.0
0.0
loss(a) 0.72 = 0.49
loss(b) 0.52 = 0.25
loss(c) 0.22 = 0.04
1st iteration 2nd iteration
loss(a) 0.42 = 0.16
loss(b) 0.22 =
0.04
loss(c) 0.12 = 0.01
+0.2
-0.1
-0.1
3rd iteration
loss(a) 0.22 = 0.04
loss(b) 0.12 =
0.01
loss(c) 0.12 =
0.01
Let’s focus on finding the
minimum loss for our
variable ‘a’
Weights through out the network are adjusted in order to reduce
the loss in prediction
0.8
0.1
0.1
x
1
x2
xn
a
b
c
28
28
28*28=784
actual probabilities
error = actual - prediction
0.2
0.
2
1.
20.
3
1.
2
0.6
0.3
6
0.4
0.9
0.3
Neural Network
1.
0
0.0
0.0
loss(a) 0.72 = 0.49
loss(b) 0.52 = 0.25
loss(c) 0.22 = 0.04
1st iteration 2nd iteration
loss(a) 0.42 = 0.16
loss(b) 0.22 =
0.04
loss(c) 0.12 = 0.01
+0.2
-0.1
-0.1
3rd iteration
loss(a) 0.22 = 0.04
loss(b) 0.12 =
0.01
loss(c) 0.12 =
0.01
Let’s focus on finding the
minimum loss for our
variable ‘a’
Weights through out the network are adjusted in order to reduce
the loss in prediction
0.8
0.1
0.1
x
1
x2
xn
a
b
c
28
28
28*28=784
actual probabilities
error = actual - prediction
0.2
0.
2
1.
20.
3
1.
2
0.6
0.3
6
0.4
0.9
0.3
Neural Network
1.
0
0.0
0.0
loss(a) 0.72 = 0.49
loss(b) 0.52 = 0.25
loss(c) 0.22 = 0.04
1st iteration 2nd iteration
loss(a) 0.42 = 0.16
loss(b) 0.22 =
0.04
loss(c) 0.12 = 0.01
+0.2
-0.1
-0.1
3rd iteration
loss(a) 0.22 = 0.04
loss(b) 0.12 =
0.01
loss(c) 0.12 =
0.01
And here is where gradient
descent comes into the
picture
Neural Network
weight
loss
0.5
1
0.1
7
0.34
w1 w2 w3
Let’s assume the below to be our graph for the loss of
prediction with variable a as compared to the weights
contributing to it from the second last layer
Neural Network
weight
loss
0.5
1
0.1
7
0.34
w1 w2 w3
Random points chosen on the graph is now backpropagated
through the network in order to adjust the weights
0.8
0.1
0.1
x
1
x2
xn
a
b
c
0.4
0.
8
0.
20.
3
0.2
1
0.2
6
0.6
1.0
0.9
1.3
Neural Network
weight
loss
0.5
1
0.1
7
0.34
w1 w2 w3
The network is run once again with the new weights
1.0
0.1
0.1
x
1
x2
xn
a
b
c
0.4
0.
8
0.
20.
3
0.2
1
0.2
6
0.6
1.0
0.9
1.3
Neural Network
weight
loss
0.5
1
0.1
7
0.34
w1 w2 w3
This process is repeated multiple times till it provides
accurate predictions
1.0
0.1
0.1
x
1
x2
xn
a
b
c
0.4
0.
8
0.
20.
3
0.2
1
0.2
6
0.6
1.0
0.9
1.3
Neural Network
weight
loss
0.5
1
0.1
7
0.34
w1 w2 w3
This process is repeated multiple times till it provides
accurate predictions
1.0
0.0
0.0
x
1
x2
xn
a
b
c
0.4
0.
8
0.
20.
3
0.2
1
0.2
6
0.6
1.0
0.9
1.3
Neural Network
weight
loss
0.5
1
0.1
7
0.34
w1 w2 w3
The weights are further adjust to identify ‘b’ and ‘c’ too
0.0
1.0
0.0
x
1
x2
xn
a
b
c
0.4
0.
8
0.
20.
3
0.2
1
0.2
6
0.6
1.0
0.9
1.3
Neural Network
0.0
1.0
0.0
x
1
x2
xn
a
b
c
0.5
0.
8
0.
20.
3
0.2
1
0.2
0.6
1.0
1.9
0.3
The weights are further adjust
to identify ‘b’ and ‘c’ too
Neural Network
0.0
00
1.0
x
1
x2
xn
a
b
c
0.4
0.
3
0.
20.
3
0.2
1
0.2
0.7
0.5
0.9
1.3
The weights are further adjust
to identify ‘b’ and ‘c’ too
Neural Network
0.0
00
1.0
x
1
x2
xn
a
b
c
0.4
0.
3
0.
20.
3
0.2
1
0.7
0.5
0.9
1.3
Thus, through gradient descent
and backpropagation, our
network is completely trained
0.2
Backpropagation And Gradient Descent In Neural Networks | Neural Network Tutorial | Simplilearn

More Related Content

What's hot

Artificial Neural Network | Deep Neural Network Explained | Artificial Neural...
Artificial Neural Network | Deep Neural Network Explained | Artificial Neural...Artificial Neural Network | Deep Neural Network Explained | Artificial Neural...
Artificial Neural Network | Deep Neural Network Explained | Artificial Neural...
Simplilearn
 
What Is A Neural Network? | How Deep Neural Networks Work | Neural Network Tu...
What Is A Neural Network? | How Deep Neural Networks Work | Neural Network Tu...What Is A Neural Network? | How Deep Neural Networks Work | Neural Network Tu...
What Is A Neural Network? | How Deep Neural Networks Work | Neural Network Tu...
Simplilearn
 

What's hot (20)

Introduction to Neural Networks
Introduction to Neural NetworksIntroduction to Neural Networks
Introduction to Neural Networks
 
Regularization in deep learning
Regularization in deep learningRegularization in deep learning
Regularization in deep learning
 
Convolutional Neural Network and Its Applications
Convolutional Neural Network and Its ApplicationsConvolutional Neural Network and Its Applications
Convolutional Neural Network and Its Applications
 
Artificial Neural Network | Deep Neural Network Explained | Artificial Neural...
Artificial Neural Network | Deep Neural Network Explained | Artificial Neural...Artificial Neural Network | Deep Neural Network Explained | Artificial Neural...
Artificial Neural Network | Deep Neural Network Explained | Artificial Neural...
 
Feedforward neural network
Feedforward neural networkFeedforward neural network
Feedforward neural network
 
Linear regression
Linear regressionLinear regression
Linear regression
 
What Is A Neural Network? | How Deep Neural Networks Work | Neural Network Tu...
What Is A Neural Network? | How Deep Neural Networks Work | Neural Network Tu...What Is A Neural Network? | How Deep Neural Networks Work | Neural Network Tu...
What Is A Neural Network? | How Deep Neural Networks Work | Neural Network Tu...
 
Ensemble learning
Ensemble learningEnsemble learning
Ensemble learning
 
Deep Feed Forward Neural Networks and Regularization
Deep Feed Forward Neural Networks and RegularizationDeep Feed Forward Neural Networks and Regularization
Deep Feed Forward Neural Networks and Regularization
 
Training Neural Networks
Training Neural NetworksTraining Neural Networks
Training Neural Networks
 
Artificial Neural Networks - ANN
Artificial Neural Networks - ANNArtificial Neural Networks - ANN
Artificial Neural Networks - ANN
 
Unsupervised learning
Unsupervised learningUnsupervised learning
Unsupervised learning
 
Naive Bayes Classifier
Naive Bayes ClassifierNaive Bayes Classifier
Naive Bayes Classifier
 
Feed forward ,back propagation,gradient descent
Feed forward ,back propagation,gradient descentFeed forward ,back propagation,gradient descent
Feed forward ,back propagation,gradient descent
 
Deep Learning - CNN and RNN
Deep Learning - CNN and RNNDeep Learning - CNN and RNN
Deep Learning - CNN and RNN
 
Introduction to Recurrent Neural Network
Introduction to Recurrent Neural NetworkIntroduction to Recurrent Neural Network
Introduction to Recurrent Neural Network
 
Introduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-LearnIntroduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-Learn
 
Back propagation
Back propagationBack propagation
Back propagation
 
Introduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersIntroduction to Machine Learning Classifiers
Introduction to Machine Learning Classifiers
 
Artificial Neural Network Lecture 6- Associative Memories & Discrete Hopfield...
Artificial Neural Network Lecture 6- Associative Memories & Discrete Hopfield...Artificial Neural Network Lecture 6- Associative Memories & Discrete Hopfield...
Artificial Neural Network Lecture 6- Associative Memories & Discrete Hopfield...
 

Similar to Backpropagation And Gradient Descent In Neural Networks | Neural Network Tutorial | Simplilearn

Wk 6 part 2 non linearites and non linearization april 05
Wk 6 part 2 non linearites and non linearization april 05Wk 6 part 2 non linearites and non linearization april 05
Wk 6 part 2 non linearites and non linearization april 05
Charlton Inao
 

Similar to Backpropagation And Gradient Descent In Neural Networks | Neural Network Tutorial | Simplilearn (20)

Introduction to PyTorch
Introduction to PyTorchIntroduction to PyTorch
Introduction to PyTorch
 
Deep Generative Models I (DLAI D9L2 2017 UPC Deep Learning for Artificial Int...
Deep Generative Models I (DLAI D9L2 2017 UPC Deep Learning for Artificial Int...Deep Generative Models I (DLAI D9L2 2017 UPC Deep Learning for Artificial Int...
Deep Generative Models I (DLAI D9L2 2017 UPC Deep Learning for Artificial Int...
 
Regression
RegressionRegression
Regression
 
Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2
 
Backpropagation - Elisa Sayrol - UPC Barcelona 2018
Backpropagation - Elisa Sayrol - UPC Barcelona 2018Backpropagation - Elisa Sayrol - UPC Barcelona 2018
Backpropagation - Elisa Sayrol - UPC Barcelona 2018
 
Mlp trainning algorithm
Mlp trainning algorithmMlp trainning algorithm
Mlp trainning algorithm
 
Chapter3 bp
Chapter3   bpChapter3   bp
Chapter3 bp
 
Neural network basic and introduction of Deep learning
Neural network basic and introduction of Deep learningNeural network basic and introduction of Deep learning
Neural network basic and introduction of Deep learning
 
A geometrical approach in Linear Programming Problems
A geometrical approach in Linear Programming ProblemsA geometrical approach in Linear Programming Problems
A geometrical approach in Linear Programming Problems
 
Regression.pptx
Regression.pptxRegression.pptx
Regression.pptx
 
Regression.pptx
Regression.pptxRegression.pptx
Regression.pptx
 
A practical Introduction to Machine(s) Learning
A practical Introduction to Machine(s) LearningA practical Introduction to Machine(s) Learning
A practical Introduction to Machine(s) Learning
 
lec-10-perceptron-upload.pdf
lec-10-perceptron-upload.pdflec-10-perceptron-upload.pdf
lec-10-perceptron-upload.pdf
 
curve fitting or regression analysis-1.pptx
curve fitting or regression analysis-1.pptxcurve fitting or regression analysis-1.pptx
curve fitting or regression analysis-1.pptx
 
Backpropagation (DLAI D3L1 2017 UPC Deep Learning for Artificial Intelligence)
Backpropagation (DLAI D3L1 2017 UPC Deep Learning for Artificial Intelligence)Backpropagation (DLAI D3L1 2017 UPC Deep Learning for Artificial Intelligence)
Backpropagation (DLAI D3L1 2017 UPC Deep Learning for Artificial Intelligence)
 
Seminar9
Seminar9Seminar9
Seminar9
 
Deep learning simplified
Deep learning simplifiedDeep learning simplified
Deep learning simplified
 
DNN.pptx
DNN.pptxDNN.pptx
DNN.pptx
 
Wk 6 part 2 non linearites and non linearization april 05
Wk 6 part 2 non linearites and non linearization april 05Wk 6 part 2 non linearites and non linearization april 05
Wk 6 part 2 non linearites and non linearization april 05
 
Real-Time Data Mining for Event Streams
Real-Time Data Mining for Event StreamsReal-Time Data Mining for Event Streams
Real-Time Data Mining for Event Streams
 

More from Simplilearn

What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
Simplilearn
 
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Simplilearn
 
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
Simplilearn
 
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Simplilearn
 
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
Simplilearn
 
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Simplilearn
 
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Simplilearn
 
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Simplilearn
 
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
Simplilearn
 
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
Simplilearn
 
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
Simplilearn
 
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
Simplilearn
 
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Simplilearn
 
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
Simplilearn
 
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
Simplilearn
 

More from Simplilearn (20)

ChatGPT in Cybersecurity
ChatGPT in CybersecurityChatGPT in Cybersecurity
ChatGPT in Cybersecurity
 
Whatis SQL Injection.pptx
Whatis SQL Injection.pptxWhatis SQL Injection.pptx
Whatis SQL Injection.pptx
 
Top 5 High Paying Cloud Computing Jobs in 2023
 Top 5 High Paying Cloud Computing Jobs in 2023  Top 5 High Paying Cloud Computing Jobs in 2023
Top 5 High Paying Cloud Computing Jobs in 2023
 
Types Of Cloud Jobs In 2024
Types Of Cloud Jobs In 2024Types Of Cloud Jobs In 2024
Types Of Cloud Jobs In 2024
 
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
 
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
 
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
 
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
 
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
 
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
 
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
 
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
 
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
 
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
 
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
 
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
 
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
 
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
 
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
 
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
 

Recently uploaded

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Recently uploaded (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 

Backpropagation And Gradient Descent In Neural Networks | Neural Network Tutorial | Simplilearn

  • 1.
  • 2. y 1 y2 y3 x 1 x2 xn This simple neural network must be trained to recognize handwritten alphabets ‘a’, ‘b’ and ‘c’ a b c Neural Network
  • 3. The handwritten alphabets are present as images of 28*28 pixels y 1 y2 y3 x 1 x2 xn a b c Neural Network 28 28
  • 4. The 784 pixels are fed as input to the first layer of our neural network y 1 y2 y3 x 1 x2 xn a b c 28*28=784 Neural Network 784 neurons 28 28
  • 5. The initial prediction is made using the random weights assigned to each channel 0.3 0.5 0.2 x 1 x2 xn a b c 0.2 0. 8 1. 20. 3 0. 2 0.3 6 0.3 6 1.4 0.9 0.3 28 28*28=784 Neural Network 28 28
  • 6. Our network predicts the input to be ‘b’ with a probability of 0.5 0.3 0.5 0.2 x 1 x2 xn a b c 0.2 0. 8 1. 20. 3 0. 2 0.3 6 0.3 6 1.4 0.9 0.328*28=784 Neural Network 28
  • 7. The predicted probabilities are compared against the actual probabilities and the error is calculated 0.3 0.5 0.2 x 1 x2 xn a b c 0.2 0. 8 1. 20. 3 0. 2 0.3 6 0.3 6 1.4 0.9 0.328*28=784 0.9 0.0 0.0 actual probabilities +0.6 -0.5 -0.2 error = actual - prediction Neural Network 28
  • 8. The magnitude indicates the amount of change while the sign indicates an increase or decrease in the weights 0.3 0.5 0.2 x 1 x2 xn a b c 0.2 0. 8 1. 20. 3 0. 2 0.3 6 0.3 6 1.4 0.9 0.328*28=784 actual probabilities error = actual - prediction Neural Network 0.0 0.0 -0.5 -0.2 28 0.9 +0.6
  • 9. The information is transmitted back through the network 0.3 0.5 0.2 x 1 x2 xn a b c 0.2 0. 8 1. 20. 3 0. 2 0.3 6 0.3 6 1.4 0.9 0.328*28=784 actual probabilities error = actual - prediction Neural Network 0.0 0.0 -0.5 -0.2 28 0.9 +0.6
  • 10. Weights through out the network are adjusted in order to reduce the loss in prediction 0.6 0.2 0.0 x 1 x2 xn a b c 28*28=784 actual probabilities +0.3 -0.2 0.0 error = actual - prediction 0.2 0. 8 1. 20. 3 0. 2 0.3 6 0.3 6 1.4 0.9 0.3 Neural Network 0.0 0.0 28 0.9
  • 11. a b c 28 28 28*28=784 actual probabilities error = actual - prediction Neural Network +0.2 -0.1 0.0 In this manner, we keep training the network with multiple inputs until it is able to predict with high accuracy 0.7 0. 1 0.0 x 1 x2 xn 0.2 0. 8 1. 20. 3 0. 2 0.3 6 0.3 6 1.4 0.9 0.3 0.0 0.0 0.9
  • 12. a b c 28 28 28*28=784 actual probabilities error = actual - prediction Neural Network 0.0 0.0 0.0 In this manner, we keep training the network with multiple inputs until it is able to predict with high accuracy 0.9 0. 1 0.0 x 1 x2 xn 0.2 0. 8 1. 20. 3 0. 2 0.3 6 0.3 6 1.4 0.9 0.3 0.0 0.0 0.9
  • 13. 28 28 1.0 0.0 1. 0 0.0 0.0 Neural Network 0.0 x 1 x2 xn a b c 28*28=784 actual probabilities 0.0 0.0 0.0 error = actual - prediction 0.4 0. 8 0. 20. 3 0.2 1 0.2 6 0.6 1.0 0.9 1.3 Similarly, our network is trained with the images for ‘b’ and ‘c’ too
  • 14. Here’s a straightforward dataset. Let’s build a neural network to predict the outputs, given the inputs Input Output 0 1 2 3 4 0 6 1 2 1 8 2 4 Example
  • 15. Input Output Neural Network x y This box represents our neural network x*w Example
  • 16. Input Output Neural Network x y ‘w’ is the weight x*w Example
  • 17. Input Output Neural Network x y The network starts training itself by choosing a random value for w x*w Example
  • 18. Input Output Neural Network x y x*wW=3 Example
  • 20. Input Output Neural Network x y x*wW=3 Example
  • 21. Input Output Neural Network x y x*wW=6 Our second model has w=6 Example
  • 22. Example Input Output Neural Network x y x*wW=6 Our second model has w=6
  • 23. Input Output Neural Network x y x*wW=6 Example
  • 24. Input Output Neural Network x y x*wW=9 And finally, our third model has w=9 Example
  • 25. Example Input Output Neural Network x y x*wW=9 And finally, our third model has w=9
  • 26. Input Output Neural Network x y x*wW=9 Example
  • 27. Example Input Output Neural Network x y x*wW=9 We, as humans, can know just by a look at the data that our weight should be 6. But how does the machine come to this conclusion?
  • 28. Loss function The loss function is a measurement of error which defines the precision lost on comparing the predicted output to the actual output loss = [(actual output) – (predicted output)]2
  • 29. Loss function Let’s apply the loss function to input value “2” Input Actual Output W=3 W=6 W=9 2 12 6 12 18 ---loss (12-6)2 = 36 (12-12)2 = 0 (12-18)2 = 36Los s ---
  • 30. Loss function We now plot a graph for weight versus loss.
  • 31. Loss function This graphical method of finding the minimum of a function is called gradient descent
  • 33. A random point on this curve is chosen and the slope at this point is calculated Gradient descent
  • 34. A random point on this curve is chosen and the slope at this point is calculated A positive slope indicates an increase in weight Gradient descent
  • 35. This time the slope is negative. Hence, another random point towards its left is chosen A positive slope indicates an increase in weight A negative slope indicates a decrease in weight Gradient descent
  • 36. Gradient descent loss This time the slope is negative. Hence, another random point towards its left is chosen A positive slope indicates an increase in weight A negative slope indicates a decrease in weight We continue checking slopes at various points in this manner
  • 37. Our aim is to reach a point where the slope is zero A positive slope indicates an increase in weight A negative slope indicates a decrease in weight A zero slope indicates the appropriate weight Gradient descent
  • 38. Our aim is to reach a point where the slope is zero A positive slope indicates an increase in weight A negative slope indicates a decrease in weight A zero slope indicates the appropriate weight Gradient descent
  • 39. Backpropagation Backpropagation is the process of updating the weights of the network in order to reduce the error in prediction
  • 40. Backpropagation The magnitude of loss at any point on our graph, combined with the slope is fed back to the network backpropagation
  • 41. Backpropagation A random point on the graph gives a loss value of 36 with a positive slope backpropagation
  • 42. Backpropagation A random point on the graph gives a loss value of 36 with a positive slope We continue checking slopes at various points in this manner A random point on the graph gives a loss value of 36 with a positive slope 36 is quite a large number. This means our current weight needs to change by a large number A positive slope indicates that the change in weight must be positive
  • 43. Backpropagation A random point on the graph gives a loss value of 36 with a positive slope We continue checking slopes at various points in this manner Similarly, another random point on the graph gives a loss value of 10 with a negative slope 10 is a small number. Hence, the weight requires to be tuned quite less A negative slope indicates that the weight needs to be reduced rather than increased
  • 44. Backpropagation After multiple iterations of backpropagation, our weights are assigned the appropriate value Input Output x y x*6
  • 45. Backpropagation After multiple iterations of backpropagation, our weights are assigned the appropriate value Input Output x y x*6 At this point, our network is trained and can be used to make predictions
  • 46. Backpropagation After multiple iterations of backpropagation, our weights are assigned the appropriate value Input Output x y x*6 Let’s now get back to our first example and see where backpropagation and gradient descent fall into place
  • 47. As mentioned earlier, our predicted output is compared against the actual output 0.3 0.5 0.2 x 1 x2 xn a b c 0.2 0. 8 1. 20. 3 0. 2 0.3 6 0.3 6 1.4 0.9 0.3 28 28 28*28=784 1. 0 0.0 0.0 actual probabilities +0.7 -0.5 -0.2 error = actual - prediction Neural Network
  • 48. As mentioned earlier, our predicted output is compared against the actual output 0.3 0.5 0.2 x 1 x2 xn a b c 0.2 0. 8 1. 20. 3 0. 2 0.3 6 0.3 6 1.4 0.9 0.3 28 28 28*28=784 1. 0 0.0 0.0 actual probabilities error = actual - prediction Neural Network +0.7 -0.5 -0.2 loss(a)  0.72 = 0.49 loss(b) 0.52 = 0.25 loss(c)  0.22 = 0.04 1st iteration
  • 49. Weights through out the network are adjusted in order to reduce the loss in prediction 0.6 0.2 0.1 x 1 x2 xn a b c 28 28 28*28=784 actual probabilities +0.4 -0.2 -0.1 error = actual - prediction 0.2 0. 8 1. 30. 3 0. 2 0.3 6 0.3 6 1.4 0.9 0.7 Neural Network 1. 0 0.0 0.0
  • 50. Weights through out the network are adjusted in order to reduce the loss in prediction 0.6 0.2 0.1 x 1 x2 xn a b c 28 28 28*28=784 actual probabilities error = actual - prediction 0.2 0. 8 1. 30. 3 0. 2 0.3 6 0.3 6 1.4 0.9 0.7 Neural Network 1. 0 0.0 0.0 loss(a) 0.72 = 0.49 loss(b) 0.52 = 0.25 loss(c) 0.22 = 0.04 1st iteration 2nd iteration loss(a) 0.42 = 0.16 loss(b) 0.22 = 0.04 loss(c)  0.12 = 0.01 +0.4 -0.2 -0.1
  • 51. Weights through out the network are adjusted in order to reduce the loss in prediction 0.8 0.1 0.1 x 1 x2 xn a b c 28 28 28*28=784 actual probabilities +0.2 -0.1 -0.1 error = actual - prediction 0.2 0. 2 1. 20. 3 1. 2 0.6 0.3 6 0.4 0.9 0.3 Neural Network 1. 0 0.0 0.0
  • 52. Weights through out the network are adjusted in order to reduce the loss in prediction 0.8 0.1 0.1 x 1 x2 xn a b c 28 28 28*28=784 actual probabilities error = actual - prediction 0.2 0. 2 1. 20. 3 1. 2 0.6 0.3 6 0.4 0.9 0.3 Neural Network 1. 0 0.0 0.0 loss(a) 0.72 = 0.49 loss(b) 0.52 = 0.25 loss(c) 0.22 = 0.04 1st iteration 2nd iteration loss(a) 0.42 = 0.16 loss(b) 0.22 = 0.04 loss(c) 0.12 = 0.01 +0.2 -0.1 -0.1 3rd iteration loss(a) 0.22 = 0.04 loss(b) 0.12 = 0.01 loss(c) 0.12 = 0.01
  • 53. Weights through out the network are adjusted in order to reduce the loss in prediction 0.8 0.1 0.1 x 1 x2 xn a b c 28 28 28*28=784 actual probabilities error = actual - prediction 0.2 0. 2 1. 20. 3 1. 2 0.6 0.3 6 0.4 0.9 0.3 Neural Network 1. 0 0.0 0.0 loss(a) 0.72 = 0.49 loss(b) 0.52 = 0.25 loss(c) 0.22 = 0.04 1st iteration 2nd iteration loss(a) 0.42 = 0.16 loss(b) 0.22 = 0.04 loss(c) 0.12 = 0.01 +0.2 -0.1 -0.1 3rd iteration loss(a) 0.22 = 0.04 loss(b) 0.12 = 0.01 loss(c) 0.12 = 0.01 Let’s focus on finding the minimum loss for our variable ‘a’
  • 54. Weights through out the network are adjusted in order to reduce the loss in prediction 0.8 0.1 0.1 x 1 x2 xn a b c 28 28 28*28=784 actual probabilities error = actual - prediction 0.2 0. 2 1. 20. 3 1. 2 0.6 0.3 6 0.4 0.9 0.3 Neural Network 1. 0 0.0 0.0 loss(a) 0.72 = 0.49 loss(b) 0.52 = 0.25 loss(c) 0.22 = 0.04 1st iteration 2nd iteration loss(a) 0.42 = 0.16 loss(b) 0.22 = 0.04 loss(c) 0.12 = 0.01 +0.2 -0.1 -0.1 3rd iteration loss(a) 0.22 = 0.04 loss(b) 0.12 = 0.01 loss(c) 0.12 = 0.01 Let’s focus on finding the minimum loss for our variable ‘a’
  • 55. Weights through out the network are adjusted in order to reduce the loss in prediction 0.8 0.1 0.1 x 1 x2 xn a b c 28 28 28*28=784 actual probabilities error = actual - prediction 0.2 0. 2 1. 20. 3 1. 2 0.6 0.3 6 0.4 0.9 0.3 Neural Network 1. 0 0.0 0.0 loss(a) 0.72 = 0.49 loss(b) 0.52 = 0.25 loss(c) 0.22 = 0.04 1st iteration 2nd iteration loss(a) 0.42 = 0.16 loss(b) 0.22 = 0.04 loss(c) 0.12 = 0.01 +0.2 -0.1 -0.1 3rd iteration loss(a) 0.22 = 0.04 loss(b) 0.12 = 0.01 loss(c) 0.12 = 0.01 And here is where gradient descent comes into the picture
  • 56. Neural Network weight loss 0.5 1 0.1 7 0.34 w1 w2 w3 Let’s assume the below to be our graph for the loss of prediction with variable a as compared to the weights contributing to it from the second last layer
  • 57. Neural Network weight loss 0.5 1 0.1 7 0.34 w1 w2 w3 Random points chosen on the graph is now backpropagated through the network in order to adjust the weights 0.8 0.1 0.1 x 1 x2 xn a b c 0.4 0. 8 0. 20. 3 0.2 1 0.2 6 0.6 1.0 0.9 1.3
  • 58. Neural Network weight loss 0.5 1 0.1 7 0.34 w1 w2 w3 The network is run once again with the new weights 1.0 0.1 0.1 x 1 x2 xn a b c 0.4 0. 8 0. 20. 3 0.2 1 0.2 6 0.6 1.0 0.9 1.3
  • 59. Neural Network weight loss 0.5 1 0.1 7 0.34 w1 w2 w3 This process is repeated multiple times till it provides accurate predictions 1.0 0.1 0.1 x 1 x2 xn a b c 0.4 0. 8 0. 20. 3 0.2 1 0.2 6 0.6 1.0 0.9 1.3
  • 60. Neural Network weight loss 0.5 1 0.1 7 0.34 w1 w2 w3 This process is repeated multiple times till it provides accurate predictions 1.0 0.0 0.0 x 1 x2 xn a b c 0.4 0. 8 0. 20. 3 0.2 1 0.2 6 0.6 1.0 0.9 1.3
  • 61. Neural Network weight loss 0.5 1 0.1 7 0.34 w1 w2 w3 The weights are further adjust to identify ‘b’ and ‘c’ too 0.0 1.0 0.0 x 1 x2 xn a b c 0.4 0. 8 0. 20. 3 0.2 1 0.2 6 0.6 1.0 0.9 1.3
  • 64. Neural Network 0.0 00 1.0 x 1 x2 xn a b c 0.4 0. 3 0. 20. 3 0.2 1 0.7 0.5 0.9 1.3 Thus, through gradient descent and backpropagation, our network is completely trained 0.2

Editor's Notes

  1. Style - 01
  2. Style - 01
  3. Style - 01
  4. Style - 01
  5. Style - 01
  6. Style - 01
  7. Style - 01
  8. Style - 01
  9. Style - 01
  10. Style - 01
  11. Style - 01
  12. Style - 01
  13. Style - 01
  14. Style - 01
  15. Style - 01
  16. Style - 01
  17. Style - 01
  18. Style - 01
  19. Style - 01
  20. Style - 01
  21. Style - 01
  22. Style - 01
  23. Style - 01
  24. Style - 01
  25. Style - 01
  26. Style - 01
  27. Style - 01
  28. Style - 01
  29. Style - 01
  30. Style - 01
  31. Style - 01
  32. Style - 01
  33. Style - 01
  34. Style - 01
  35. Style - 01
  36. Style - 01
  37. Style - 01
  38. Style - 01
  39. Style - 01
  40. Style - 01
  41. Style - 01
  42. Style - 01
  43. Style - 01
  44. Style - 01
  45. Style - 01
  46. Style - 01
  47. Style - 01
  48. Style - 01
  49. Style - 01
  50. Style - 01
  51. Style - 01
  52. Style - 01
  53. Style - 01
  54. Style - 01
  55. Style - 01
  56. Style - 01
  57. Style - 01
  58. Style - 01
  59. Style - 01
  60. Style - 01
  61. Style - 01
  62. Style - 01
  63. Style - 01