

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Figure 1: A two layer Neural Network
To understand what to implement for dOutDx(self, weight) for lab 5, you'll need to
thoroughly understand how the error update equation for back-propagation is fully derived. Recall from lecture that the error update equation for back propagation is:
.
Here, is a derivative defined for all weights w in the network. This guide will show that
this derivative can be constructed from and i.e. the dOutDx for Neuron and Inputs
elements in the network. Let's take a look at the derivatives in terms of the three types of elements.
expansion of gives us:
We already know the mathematical expression for the first term. But what about the second
term? Isn't that just dOutDx (w) called on neuron C?
and
Case 1 : involves a weight that is connected directly into Neuron C.
Expanding by chain rule:
= Expanding out z (^) C
What is oA? That's just calling output () on neuron A! You can access Neuron A by calling
the API get_inputs () from neuron C!
Case 2 : involves a weight that is further downstream from Neuron C:
By faithfully expanding the derivative via the chain rule, we get:
=
= derivative of the input unit
is 0
Q: So what are the programmatic equivalents of and?
A: They are just the value of calling dOutDx (w1A) on neuron A and neuron B respectively!
Working these two derivatives out by hand illustrates the two key cases that your code needs to handle.
So think of structuring your dOutDx code for Neurons in terms of these two cases: