Zum Inhalt springen
L

Das Video kommt von YouTube: erst beim Abspielen verbindet sich die Seite mit YouTube (Google).

#1 Solved Example Back Propagation Algorithm Multi-Layer Perceptron Network by Dr. Mahesh Huddar

Mahesh Huddar14:31 1,4 Mio. Aufrufe veröffentlicht Auf YouTube

Das Wichtigste aus dem Video

Tipp auf eine Zeit – das Video springt genau dorthin.

Transkriptautomatisch erstellt · 96 Zeilen
Herunterladen
  1. hi welcome back in this video i will discuss how to apply back propagation algorithm
  2. to update the weights in multi-layer perceptron network this is the problem definition assume that the neurons have sigmoid
  3. activation function perform the forward pass and backward pass on the network assume that the actual output is 0.5 and
  4. the learning rate is 1 in this case perform another forward pass so this is the network given to us in this case so we have two inputs that is x1 and x2
  5. with values 0.35 and 0.9 there is one hidden layer with two neurons h3 and h4 and one output neuron that is o5 in this
  6. case y3 and y4 are the outputs of hidden unit and wi-fi is the output of output unit in this case
  7. w13 w14 w23 and w24 are the hidden layer weights with the initial weights of 0.1 0.4 0.8 and 0.6 respectively
  8. w35 and w45 are the output unit weights with 0.3 and 0.9 respectively now what we need to do here is we need to propagate this input
  9. through this network by calculating the output at the hidden needs as well as the output at the output layer
  10. once you calculate this output we need to check what is the error at the output unit and then that error should be propagated back to this particular
  11. hidden units and then we need to calculate the error at hidden units also based on this particular error terms we
  12. need to update this particular weights and then we need to propagate this input again in the forward pass that is nothing but
  13. perform another forward pass here similarly we have to do this particular steps again and again unless and until we are happy with the error what we get
  14. at the output layer here but in this case i'm going to show it for two times one time i will propagate the
  15. input i will update the weights and then i will propagate the input through this particle network one more time so that
  16. is two times i will show here now we will try to propagate this input through the network that is the forward pass here for that
  17. reason we need to calculate this y3 y4 first and then these y3 and y4 are the inputs to this particular o5 again we will calculate wi-fi here
  18. to calculate this y3 and y4 first we need to calculate what is that called as the summation term that is nothing but w
  19. i j multiplied by x i once you calculate this particular summation term we need to apply the activation function so that i will get
  20. this particular y 3 and y 4. similarly we need to give this y y 3 and y 4 as the input to here and then we need to calculate the summation term and
  21. then again we need to apply the activation function so that i will get the wi-fi here now what is the actuation function i'm
  22. going to use i'm going to use the activation function as the sigma term that is nothing but 1 divided by 1 plus e raised to
  23. minus x in this case i'm calculating aj hence it is minus aj here so first we will calculate the value of aj that is the summation term at h3
  24. that is nothing but a1 here a1 is equivalent to w 1 3 multiplied by x 1 plus w 2 3 multiplied by x 2 so that is the
  25. term over here so if i put those particular values i will get 0.755
  26. that is w13 is 0.1 x1 is 0.35 that is the term over here similarly point 8 is w2 3 and x2 is 0.9 so that is what i have written here
  27. now once you get this particular a1 i have to apply the activation function so that i will get y 3 here y 3 is equal to f of a 1 which is equivalent to 1
  28. divided by 1 plus e raised to minus a 1 here a 1 value is 0.755 i will get 0.68 in this case so this is the output at h3 here
  29. similarly i will calculate the output at h4 that is nothing but a2 is equal to w14 multiplied by x1 plus w 2 4
  30. multiplied by x 2 so that is what i have written here and then i will put the values i will get a 2 as 0.68 i will calculate the y 4 by applying
  31. activation function here y 4 is equal to 1 divided by 1 plus e raised to minus a 2 that is 0.68 i will get a 0.6637 here
  32. so i got the value of y 3 i got the value of 4 by 4 here now i will give this as an input to this o5 and then calculate wi-fi here
  33. so if i want to calculate the wi-fi first i will calculate e3 here a3 is nothing but w35 multiplied by y3 plus w 4 5 multiplied by y 4 here
  34. so i will put all those particular values here i will get 0.801 as the a3 now i will put this particular
  35. a3 or i will pass a3 as to the activation function i will get wi-fi here wi-fi is equivalent to f of a3 that is nothing but 1 divided by 1 plus e
  36. raised to minus a3 e3 values 0.801 which is equal to 0.69 that is the output at the output unit here so the output at the output in it is 0.69
  37. now what is the expected output the expected output is 0.5 but i am getting 0.69 so the error is equivalent to the expected is 0.5 here but i am
  38. getting point what we can say that 0.69 so the error will be in this case we can say that minus 0.19 in this case so this is how actually we can propagate
  39. the input through the network and then we calculate the error here now once you calculate this error uh we have to cross check whether i'm happy
  40. with the error or not if it is not we have to update this particular weights in this case i will try to update the
  41. weights and then i will try to show how can we reduce this particular error over here now if i want to update the weights we
  42. have to use this particular equation that is uh delta wji is equivalent to n that is the learning rate multiplied by delta j that is the error term at the
  43. jth unit oi is nothing but the output at ith unit in this case now how to calculate this particular delta j because we know the value of the
  44. learning rate that is equivalent to 1 in this case that is a constant value we can consider for a given problem but delta j is the error at the jth unit
  45. so we have to calculate it so there are two kind of units are there uh in this case you can see here these two h3 and h4 are the hidden units o5 is
  46. the output in it so if the j is the output in it the delta j is equivalent to oj multiplied by 1
  47. minus oj multiplied by tj minus oj that is the output at the jth unit multiplied by 1 minus output at jth unit multiplied by target
  48. minus the calculated output at the jth unit similarly if j is the hidden unit now we used need to use this equation that is
  49. delta j is equivalent to again vj multiplied by 1 minus oj but summation of delta k multiplied by k j where k is the number of output units in
  50. this case so using these particular equations we calculate the delta j term we have already calculated the output at each
  51. unit using those three we will calculate the modified weight in this case so first we will try to calculate the delta term at each and every unit so
  52. first we calculate the delta term at the output in it that is delta 5 because it's the output in it which is equivalent to y minus 1 minus y that is
  53. the calculated output multiplied by 1 minus calculated output multiplied by what is the value we have here
  54. this is t j multi minus oj tj is what the target output that is 0.5 what we are expecting and why is the calculated output
  55. so what is the calculated output in this case is 0.69 0.69 1 minus 0.69 0.5 is the target 0.69 is the calculated output hence delta 5 is equivalent to
  56. minus 0.0406 here now we will try to understand how to calculate the error term at h3 here so
  57. if you want to calculate error at h3 the equation is uh we have to use this one the second equation that is delta 3 is equal to y3 multiplied by 1 minus y3
  58. that is the calculated output that is 3 multiplied by 1 minus y3 multiplied by this weight that is w35 and the error calculated at the output in it that is
  59. delta phi because we have only one output in it we get the summation term as only once if we have multiple number of output ends i will get the summation
  60. here i will put all the values here i will get the answer as point minus 0.00265
  61. similarly i will calculate the error term at h1 also that is delta 4 is equivalent to y4 multiplied
  62. by 1 minus y4 multiplied by this error weight and the error at this particular output in it that is 0.9 multiplied by this we have
  63. already calculated i will put it over here so the total answer in this case is minus
  64. 0.008 to here so what we did is we calculated error at the output in it we calculated the error at the hidden units so using this thing
  65. we have to modify this particular weights here that is a delta wj is equivalent to learning rate multiplied by delta j
  66. multiplied by oi here so what i do here is i will put the calculated values uh i will show one example that is a
  67. point w four five delta w four five is equivalent to n multiplied by delta phi
  68. y 4 which is equivalent to point minus point 0 to 6 9 similarly we will calculate uh one more
  69. this is a delta term actually this is not the final term this is just a delta term so what we do is we will add this thing to the previous weight what is the
  70. previous weight here 0.9 so to this particular previous weight we will add this particular the delta term
  71. if i add it i will get this particular thing that is nothing but the modified weight here similarly i will show one more that is
  72. uh w one four w one four is equivalent to n multiplied by delta four x one uh that is 1 multiplied by
  73. the delta 4 we know that value delta 4 somewhere we have calculated it this is the delta 4 value multiplied by 0.35 that is x 1 uh the
  74. delta term what we get here is or you can say that the increment or decrement we will get is uh minus
  75. 0.20287 once you add it to the old value i will get the modified weight here so this is the modified weight
  76. so this is how actually we can calculate the modified weights in this case i have shown two this point nine is modified to 0.8731
  77. and this point four is modified to point three nine seven one in this iteration similarly we have to calculate all the
  78. modified weights here so once you calculate this particular modified weights you can see here wji is calculated for every combination
  79. and then we have got this particular updated the wgi by adding this particular delta wji to the old value
  80. now once you get this particular updated values so for all the weights we the network looks something like this you can see here w one three is equal to
  81. point zero zero zero nine nine one uh w two four is equal to point uh five nine two six and so on again we need to forward uh pass this
  82. particle x1 and x2 forward through this network and then we need to calculate the output if the output is
  83. correct or acceptable we can stop here otherwise we need to use the same process like calculating the error at each neuron updating the
  84. weights and then passing this particular input forward through this network the same process
  85. has to be followed again and again in this case so first what we do is we try to calculate what is y3 y4 and y5
  86. y3 if you want to calculate first we need to calculate the summation term and then we need to apply this activation function again here
  87. so we have this value so we've calculated y3 is 0.6797 so previous value was 0.68 now it is
  88. modified to 0.6797 similarly we calculate uh the y4 first we calculate the summation term and then we use this activation
  89. function to get this particular value now the modified y4 is 0.6620 previously it was 0.6637 we calculate the output at the output
  90. layer which is equivalent to 0.6820 here previously it was 0.69 once you do this particular thing we try
  91. to calculate the error here so error in this case is 0.5 minus 0.6820 which is equivalent to point minus 0.182 in this case
  92. now in this case i have shown only two forward passes but actually uh if you are not happy with this particular error uh you have to do this
  93. thing again and again like modifying the weights and then for passing this particular input forward through this particle network and so on
  94. so in this video i try to explain how we can apply back propagation algorithm in multi-layer perceptron network so that we can update the weights
  95. until we get the acceptable output in this case i hope the concept is clear if you like the video do like and share
  96. with your friends press the subscribe button for more videos press the bell icon for regular updates thank you for watching

Zum Nachlesen