1 / 40

Class Exercise

The back-propagation training algorithm. Class Exercise. æ. ö. 2. . 4. 2. . 4. ç. ÷. -. +. ,. ç. ÷. F. F. è. ø. i. i. The back-propagation training algorithm. Step 1 : Initialisation

taini
Download Presentation

Class Exercise

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The back-propagation training algorithm Class Exercise

  2. æ ö 2 . 4 2 . 4 ç ÷ - + , ç ÷ F F è ø i i The back-propagation training algorithm Step 1: Initialisation Set all the weights and threshold levels of the network to random numbers uniformly distributed inside a small range: where Fi is the total number of inputs of neuron i in the network. The weight initialisation is done on a neuron-by-neuron basis.

  3. Step 2: Activation Activate the back-propagation neural network by applying inputs x1(p), x2(p),…, xn(p) and desired outputs yd,1(p), yd,2(p),…, yd,n(p). (a) Calculate the actual outputs of the neurons in the hidden layer: where n is the number of inputs of neuron j in the hidden layer, and sigmoid is the sigmoid activation function.

  4. Step 2: Activation (continued) (b) Calculate the actual outputs of the neurons in the output layer: where m is the number of inputs of neuron k in the output layer.

  5. Step 3: Weight training Update the weights in the back-propagation network propagating backward the errors associated with output neurons. (a) Calculate the error gradient for the neurons in the output layer: where Calculate the weight corrections: Update the weights at the output neurons:

  6. Step 3: Weight training (continued) (b) Calculate the error gradient for the neurons in the hidden layer: Calculate the weight corrections: Update the weights at the hidden neurons:

  7. Step 4: Iteration Increase iteration p by one, go back to Step 2 and repeat the process until the selected error criterion is satisfied.

  8. As an example, we may consider the three-layer back-propagation network. • Suppose that the network is required to perform logical operation Exclusive-OR. • Recall that a single-layer perceptron could not do this operation. Now we will apply the three-layer net.

  9. Three-layer network for solving the Exclusive-OR operation

  10. The effect of the threshold applied to a neuron in the hidden or output layer is represented by its weight, , connected to a fixed input equal to 1. • The initial weights and threshold levels are set randomly as follows: • w13 = 0.5, w14 = 0.9, w23 = 0.4, w24 = 1.0, w35 = 1.2, w45 = 1.1, 3 = 0.8, 4 = 0.1 and 5 = 0.3.

  11. We consider a training set where inputs x1 and x2 are equal to 1 and desired output yd,5 is 0. The actual outputs of neurons 3 and 4 in the hidden layer are calculated as • Now the actual output of neuron 5 in the output layer is determined as: • Thus, the following error is obtained:

  12. The next step is weight training. To update the weights and threshold levels in our network, we propagate the error, e, from the output layer backward to the input layer. • First, we calculate the error gradient for neuron 5 in the output layer: • Then we determine the weight corrections assuming that the learning rate parameter, , is equal to 0.1:

  13. Next we calculate the error gradients for neurons 3 and 4 in the hidden layer: • We then determine the weight corrections:

  14. = + D = + = w w w 0 . 5 0 . 0038 0 . 5038 13 13 13 = + D = - = w w w 0 . 9 0 . 0015 0 . 8985 14 14 14 = + D = + = w w w 0 . 4 0 . 0038 0 . 4038 23 23 23 = + D = - = w w w 1 . 0 0 . 0015 0 . 9985 24 24 24 = + D = - - = - w w w 1 . 2 0 . 0067 1 . 2067 35 35 35 = + D = - = w w w 1 . 1 0 . 0112 1 . 0888 45 45 45 q = q + D q = - = 0 . 8 0 . 0038 0 . 7962 3 3 3 q = q + D q = - + = - 0 . 1 0 . 0015 0 . 0985 4 4 4 q = q + D q = + = 0 . 3 0 . 0127 0 . 3127 5 5 5 • At last, we update all weights and threshold: • The training process is repeated until the sum of squared errors is less than 0.001.

  15. Learning curve for operation Exclusive-OR

  16. Final results of three-layer network learning

  17. Network represented by McCulloch-Pitts model for solving the Exclusive-OR operation

  18. Decision boundaries (a) Decision boundary constructed by hidden neuron 3; (b) Decision boundary constructed by hidden neuron 4; (c) Decision boundaries constructed by the complete three-layer network

  19. VARIATIONS in multilayer neural networks • Modifications can be made to improve performance of BP • May involve: • Changes in weight update procedure • Alternative to sigmoid activation function • Improve the computational power

  20. Alternative Weight Update Procedures • Momentum • BP with momentum, the weight change using combination of current and previous gradient • Advantage when some training data are very different/unusual from the majority of the data (or incorrect) • Use a small learning rate to avoid a major disruption of learning • Or maintain training pace

  21. Alternative Weight Update Procedures • Momentum • Faster convergence with momentum • To use momentum, weights from 1 or more previous training need to be saved

  22. Alternative Weight Update Procedures • BP with momentum wjk(t+1) = wjk(t) + kzj + [wjk(t) – wjk(t - 1)] wjk(t+1) = kzj + wjk(t) and vij(t + 1) = vij(t) + jxi + [vij(t) – vij(t - 1)] vij(t + 1) = jxi + vij(t)

  23. Alternative Weight Update Procedures • Advantage of adding Momentum • Allows the net to make reasonably large weight adjustments as long as the corrections are in the same general direction for several patterns while using small learning rate to prevent a large response to the error from any one training patterns • Reduce local minimum • In momentum, the net is proceeding not in the direction of the gradient, but the direction of a combination of the current gradient and the previous direction of weight correction

  24. Alternative Weight Update Procedures • Example of adding Momentum • Example 6.1-6.3, using the same initial weights and architecture, adding momentum 0.9 with a learning rate as before (0.2) reduces training requirements from 387 epochs to 38 epochs.

  25. Adaptive Learning Rates • Changing learning rate during training • Delta-Bar-Delta • Allow each weight to have its own learning rate • Let the learning rates vary with time as training progresses

  26. Adaptive Learning Rates To accelerate the convergence and yet avoid the danger of instability, we can apply two heuristics: Heuristic 1 If the change of the sum of squared errors has the same algebraic sign (direction) for several consequent epochs, then the learning rate parameter, , should be increased. Heuristic 2 If the algebraic sign of the change of the sum of squared errors alternates for several consequent epochs, then the learning rate parameter, , should be decreased.

  27. Adapting the learning rate requires some changes in the back-propagation algorithm. • If the sum of squared errors at the current epoch exceeds the previous value by more than a predefined ratio (typically 1.04), the learning rate parameter is decreased (typically by multiplying by 0.7) and new weights and thresholds are calculated. • If the error is less than the previous one, the learning rate is increased (typically by multiplying by 1.05).

  28. Adaptive Learning Rates • Formula Delta-bar delta rule • Weight update rule • Learning rate update rule wij(t) : arbitrary weight at time t ij(t) : learning rate for that weight at time t E : squared error for the pattern presented at time t

  29. E wjk E jk = wjk Adaptive Learning Rates • Formula Delta-bar delta rule • Weight update rule • Learning rate update rule • wjk(t + 1) = wjk(t) - jk(t + 1) • = wjk(t) - jk(t + 1)kzj = -kzj Where standard weight changes Pp 308

  30. Adaptive Learning Rates • Performance METHOD SIMULATIONS SUCCESSES MEAN EPOCH BP 25 24 16,859.8 BP+momentum 25 25 2,056.3 Delta-bar-delta 25 22 447.3

  31. E wjk E jk = wjk Adaptive Learning Rates • Formula Delta-bar delta rule • Weight update rule • Learning rate update rule • wjk(t + 1) = wjk(t) - jk(t + 1) • = wjk(t) - jk(t + 1)kzj = -kzj Where standard weight changes Pp 308

  32. Learning with adaptive learning rate

  33. Learning with momentum and adaptive learning rate

  34. Accelerated learning in multilayer neural networks • A multilayer network learns much faster when the sigmoidal activation function is represented by a hyperbolic tangent: • where a and b are constants. • Suitable values for a and b are: • a = 1.716 and b = 0.667

  35. We also can accelerate training by including a momentum term in the delta rule: where  is a positive number (0  1) called the momentum constant. Typically, the momentum constant is set to 0.95. This equation is called the generalised delta rule.

  36. Learning with momentum for operation Exclusive-OR

  37. Learning with adaptive learning rate To accelerate the convergence and yet avoid the danger of instability, we can apply two heuristics: Heuristic 1 If the change of the sum of squared errors has the same algebraic sign for several consequent epochs, then the learning rate parameter, , should be increased. Heuristic 2 If the algebraic sign of the change of the sum of squared errors alternates for several consequent epochs, then the learning rate parameter, , should be decreased.

  38. Adapting the learning rate requires some changes in the back-propagation algorithm. • If the sum of squared errors at the current epoch exceeds the previous value by more than a predefined ratio (typically 1.04), the learning rate parameter is decreased (typically by multiplying by 0.7) and new weights and thresholds are calculated. • If the error is less than the previous one, the learning rate is increased (typically by multiplying by 1.05).

  39. Learning with adaptive learning rate

  40. Learning with momentum and adaptive learning rate

More Related