Docsity

Derivation of Error Update Equation for Backpropagation in Neural Networks, Exercises of Artificial Intelligence

Toggle sidebar
bg1
Top Down Approach To Neural Nets
MAJOR HINT for Neural Nets portion of Lab 5
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.
1. Performance Node: This is the top most derivative we consider. The chain rule
expansion of gives us:
=
We already know the mathematical expression for the first term. But what about the second
docsity.com
pf3

Partial preview of the text

Download Derivation of Error Update Equation for Backpropagation in Neural Networks and more Exercises Artificial Intelligence in PDF only on Docsity!

MAJOR HINT for Neural Nets portion of Lab 5

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.

  1. Performance Node: This is the top most derivative we consider. The chain rule

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?

  1. Input Node: This one is easy!. Since weights are not related to inputs.
  2. Neuron Nodes: In reference to the two-layer net (Figure 1), consider the following two cases:

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:

  1. When w is a weight that is directly connected to the current neuron (check using