Step 2 – backpropagation and weight updation

We calculate the total error at the output nodes and propagate these errors back through the network using backpropagation to calculate the gradients. Then, we use an optimization method such as gradient descent to adjust all weights in the network with an aim of reducing the error at the output layer.

Suppose that the new weights associated with the node in consideration are w4, w5, and w6 (after backpropagation and adjusting weights).

If we now feed the same sample as an input to the network, the network should perform better than the initial run since the weights have now been optimized to minimize the error in prediction. The errors at the output nodes now reduce to [0.2, -0.2] as compared to [0.6, -0.4] earlier. This means that our network has learned to correctly classify our first training sample.

We repeat this process with all other training samples in our dataset. Then, our network is said to have learned those examples.

If we now want to predict whether a student studying 25 hours and having 70 marks in the mid term will pass the final term, we go through the forward propagation step and find the output probabilities for pass and fail.

I have avoided mathematical equations and explanation of concepts such as gradient descent here and have rather tried to develop an intuition for the algorithm. For a more mathematically involved discussion of the backpropagation algorithm, refer to this link: http://home.agh.edu.pl/%7Evlsi/AI/backp_t_en/backprop.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset