0% found this document useful (0 votes)
354 views3 pages

Backpropagation Algorithm Derivation

Chapter 4 discusses the derivation of the BACKPROPAGATION weight-tuning rule used in artificial neural networks, specifically focusing on stochastic gradient descent. It outlines the mathematical framework for updating weights based on training examples, detailing the influence of both output and hidden units on the network's performance. The chapter emphasizes the importance of understanding the relationships between units in the network to effectively implement the weight update rules.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
354 views3 pages

Backpropagation Algorithm Derivation

Chapter 4 discusses the derivation of the BACKPROPAGATION weight-tuning rule used in artificial neural networks, specifically focusing on stochastic gradient descent. It outlines the mathematical framework for updating weights based on training examples, detailing the influence of both output and hidden units on the network's performance. The chapter emphasizes the importance of understanding the relationships between units in the network to effectively implement the weight update rules.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CHAPTER 4 ARTIFICIAL NEURAL NETWORKS 101

where Downstream(r) is the set of units immediately downstream from unit r in


the network: that is, all units whose inputs include the output of unit r. It is this
gneral form of the weight-update rule that we derive in Section 4.5.3.

4.5.3 Derivation of the BACKPROPAGATION


Rule
This section presents the derivation of the BACKPROPAGATION weight-tuning rule.
It may be skipped on a first reading, without loss of continuity.
The specific problem we address here is deriving the stochastic gradient de-
scent rule implemented by the algorithm in Table 4.2. Recall from Equation (4.l l )
that stochastic gradient descent involves iterating through the training examples
one at a time, for each training example d descending the gradient of the error
Ed with respect to this single example. In other words, for each training example
d every weight wji is updated by adding to it Awji

where Ed is the error on training example d, summed over all output units in the
network

Here outputs is the set of output units in the network, tk is the target value of unit
k for training example d, and ok is the output of unit k given training example d.
The derivation of the stochastic gradient descent rule is conceptually straight-
forward, but requires keeping track of a number of subscripts and variables. We
will follow the notation shown in Figure 4.6, adding a subscript j to denote to
the jth unit of the network as follows:

xji = the ith input to unit j


wji = the weight associated with the ith input to unit j
netj =xi wjixji (the weighted sum of inputs for unit j )
oj = the output computed by unit j
t, = the target output for unit j
a = the sigmoid function
outputs = the set of units in the final layer of the network
Downstream(j) = the set of units whose immediate inputs include the
output of unit j

We now derive an expression for 2 in order to implement the stochastic


gradient descent rule seen in Equation (4:2l). To begin, notice that weight wji
can influence the rest of the network only through netj. Therefore, we can use the
102 MACHINE LEARNING

chain rule to write

for z.
Given Equation (4.22), our remaining task is to derive a convenient expression
We consider two cases in turn: the case where unit j is an output unit
for the network, and the case where j is an internal unit.

Case 1: raini in^ Rule for Output Unit Weights. Just as wji can influence the
rest of the network only through net,, net, can influence the network only through
o j . Therefore, we can invoke the chain rule again to write

To begin, consider just the first term in Equation (4.23)

The derivatives &(tk - ok12 will be zero for all output units k except when k = j.
We therefore drop the summation over output units and simply set k = j.

Next consider the second term in Equation (4.23). Since oj = a(netj), the
derivative $ is just the derivative of the sigmoid function, which we have
already noted is equal to a(netj)(l - a(netj)).Therefore,

Substituting expressions (4.24) and (4.25) into (4.23), we obtain


and combining this with Equations (4.21) and (4.22), we have the stochastic
gradient descent rule for output units

Note this training rule is exactly the weight update rule implemented by Equa-
tions (T4.3) and (T4.5) in the algorithm of Table 4.2. Furthermore, we can see
now that Sk in Equation (T4.3) is equal to the quantity -$. In the remainder
of this section we will use Si to denote the quantity -% for an arbitrary unit i .

Case 2: Training Rule for Hidden Unit Weights. In the case where j is an
internal, or hidden unit in the network, the derivation of the training rule for wji
must take into account the indirect ways in which wji can influence the network
outputs and hence Ed. For this reason, we will find it useful to refer to the
set of all units immediately downstream of unit j in the network (i.e., all units
whose direct inputs include the output of unit j). We denote this set of units by
Downstream( j). Notice that netj can influence the network outputs (and therefore
E d ) only through the units in Downstream(j). Therefore, we can write

Rearranging terms and using S j to denote -$,we have

and

which is precisely the general rule from Equation (4.20) for updating internal
unit weights in arbitrary acyclic directed graphs. Notice Equation (T4.4) from
Table 4.2 is just a special case of this rule, in which Downstream(j) = outputs.

Common questions

Powered by AI

The chain rule is pivotal in deriving the backpropagation weight-tuning rule as it allows the decomposition of the derivative of the error function with respect to a weight into a product of simpler derivatives. For output units, it simplifies calculating the derivative of the error with respect to netj by breaking it down into the derivative of the error with respect to the output and the derivative of the output with respect to netj. Similarly, for hidden units, it helps to establish how changes in the unit weights indirectly affect the error through downstream connections. This recursive application of the chain rule is critical because it accounts for the complex dependencies across layers, enabling the calculation of weight updates necessary for minimizing error in the network .

In the derivation of the backpropagation rule, the handling of output units and hidden units differs in terms of how the influence of weights is calculated. For output units, the error gradient is directly computed as it depends only on the output of the unit itself and its comparison to the target value. This involves straightforward application of the chain rule to calculate the derivative of the error with respect to the output. For hidden units, however, the effect of a weight is indirect due to dependencies on downstream units. Therefore, the error gradient for hidden units is computed by considering the weighted sum of errors from downstream units, using the derivative of the activation function. This requires recursive application of the chain rule to capture the influence through all connected layers .

The notation used in the backpropagation derivation process is crucial for maintaining clarity and precision when expressing complex mathematical relationships. Each symbol and subscript uniquely identifies specific components, like weights, units, or activation values, which are essential for accurately following the chain rule and other derivations. For instance, terms like netj, wji, and Downstream(j) clearly delineate the flow and relationship between units in the network, essential for systematically applying the gradient descent algorithm. This precision is necessary to ensure consistency, avoid errors, and facilitate understanding and communication of the derivation across various computational scenarios .

In artificial neural networks, 'Downstream(r)' is the set of units immediately downstream from unit r, which means all units whose inputs include the output of unit r. This concept is crucial in the backpropagation rule derivation because it identifies how changes in one unit's output can affect units that rely on it for input. For example, when deriving the stochastic gradient descent rule, understanding the downstream units helps predict how a weight change will affect the overall network error, because these changes propagate through the network only via these downstream connections. Specifically, in the derivation, 'Downstream(j)' refers to the units whose immediate inputs include the output of unit j, which plays a role in how netj can influence network outputs and hence the error Ed .

The sigmoid function is utilized in backpropagation for its properties of providing a smooth gradient and mapping input values to a range between 0 and 1. During backpropagation, when deriving the adjustment to weights, the derivative of the sigmoid function is used because it simplifies the calculation of gradients. Specifically, the derivative of the sigmoid, a(netj)(1-a(netj)), allows us to compute how small changes in the input will affect the output, making it easy to adjust weights to minimize error. This is critical for efficiently calculating the partial derivatives required for the gradient descent process, enabling the network to learn effectively .

Differentiating between the error contribution from output and hidden units is significant because it ensures precise adjustment of weights, tailored to the hierarchical impact of each layer on the overall error. In output units, errors are directly attributable to the difference between predicted and actual outputs, allowing precise gradients to direct weight updates. In hidden units, however, the errors are indirectly related through the network's deeper layers; hence, their gradients must account for the propagation through downstream units. This distinction is crucial as it dictates the correct propagation of error signals backward through the network, ensuring that weight updates reflect the true impact on final predictions, thereby improving learning efficiency and accuracy .

The derivation process of stochastic gradient descent significantly impacts the computational complexity of training neural networks. As the derivation highlights, each weight update depends on the error's gradient concerning that specific weight, computed for each training example. This implies that for networks with a large number of weights or complex architectures, the computational demands increase considerably because the gradient for every individual weight must be recalculated repeatedly. However, the stochastic nature of the method also means that it can, under certain circumstances, require fewer epochs to converge compared to methods like batch gradient descent, due to frequent updates and potentially better exploration of the error surface. Consequently, while the complexity per iteration is lower, the overall computational load may still be high depending on the size of the data and network structure, thus necessitating trade-offs between speed and accuracy .

The stochastic gradient descent (SGD) method is significant because it enables efficient and scalable training of artificial neural networks. SGD iterates over training examples one at a time, updating the model's weights based on the gradient of the error for each example. This allows for more frequent updates, potentially leading to faster convergence compared to batch gradient descent. By focusing on individual examples, SGD can also navigate the error landscape more dynamically, helping avoid local minima and improving generalization. Consequently, it is a popular choice for optimizing neural networks, especially when dealing with large datasets .

The expression derived for 'Si,' where Si denotes -δi for an arbitrary unit i, facilitates understanding of the weight update rule by providing a concise way to represent the gradient of the error with respect to the output of that unit. It encapsulates the contribution of weight wji to the network's overall error, streamlining the calculation of weight adjustments. By representing these partial derivatives compactly, the expression helps simplify the recursive computations necessary for backpropagation, thereby clarifying how each individual unit's output affects the subsequent layers and ultimately the network's predictions. This clarity is instrumental in implementing and troubleshooting weight updates effectively .

The general weight-update rule for internal units in neural networks is distinguished from that for output units by the nature of their error propagation. For output units, the weight update relies directly on the difference between the actual and predicted outputs, allowing a straightforward application of the chain rule to adjust the weights. For internal units, however, the update must consider the indirect influence of weights on the error via downstream units. Thus, the weight-update rule for internal units involves aggregating the weighted gradients of all directly affected downstream units, making the process inherently more complex and nuanced, as it must account for the deeper indirect dependencies within the network hierarchy .

You might also like