{"id":81,"date":"2018-07-13T05:22:50","date_gmt":"2018-07-13T05:22:50","guid":{"rendered":"http:\/\/itp6.epgpbooks.inflibnet.ac.in\/?post_type=chapter&#038;p=81"},"modified":"2019-05-16T04:26:03","modified_gmt":"2019-05-16T04:26:03","slug":"learning-process-in-bpnn-and-hopfield-networks","status":"publish","type":"chapter","link":"https:\/\/ebooks.inflibnet.ac.in\/itp6\/chapter\/learning-process-in-bpnn-and-hopfield-networks\/","title":{"rendered":"Learning process in BPNN and Hopfield networks"},"content":{"raw":"<div><span style=\"float: right;\"><a href=\"https:\/\/youtu.be\/2k0pk8CMppE\" target=\"_blank\" rel=\"noopener\"><img src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"epgp books\" width=\"75px\" height=\"75px;\" \/><\/a>\r\n<\/span><\/div>\r\n<div>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><strong>Introduction<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">This module extends the discussion that we started in the previous module. We looked at how multilayer perceptrons or multilayer networks can be designed and how the activations are calculated for the input. Now we will see how learning is done and how weights are updated in BPNN. We will also see how Hopfield networks are used for content addressability in this module.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><strong>Learning in Back Propagation network<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">Back propagation network or BPNN is a neural network for which learning we can apply back propagation algorithm. The figure 10.5 that we have seen in previous module is an example of back propagation network. The back propagation network is popularly known as BPNN.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">The forward activations (<em>h<\/em>i and <em>o<\/em>j) are calculated based on sigmoid activation function. Once the output is received for a given input, the weights must be adjusted for making sure better output is achieved next time. We have already seen that adjustment of weight is decided based on the error that we received. The output is a real value between 0 and 1 and the required value is either 0 or 1. For example if for a given face, the correct output is 0,0,0,0,1,1, and we might get 0.10, 0.01, 0.92,0.25,0.92,0.87 as the output (considering two digits after the decimal point and truncating the output accordingly) of each layer. Now the difference at each unit can be calculated as 0.10, 0.01, 0.92, 0.25, 0.08, 0.13 (the difference between actual values calculated and required output) Now we decide what our tolerance level is. Suppose if our tolerance level is 0.10, three units have correctly learned (their difference is less than or equal to 0.10) while the rest are still to be learned. Their weights are to be reduced if they are positively misclassified or increased otherwise. Look at output units 1 and 2, both of them are learned so do not require additional learning. So no weight update takes place for them. Look at the third unit. It should output 0 but provides 0.92 and thus the weights associated to the lines connecting to output unit 3 (o3) must be reduced. Similarly output unit 5 must increase its weights a little further.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">The only issue now is to find out the exact values of weights to be increased or decreased for each erring input. For that, let us assume that <em>o<\/em>j is the output received and <em>y<\/em>j is the actual output received. The weights associated <em>w<\/em>ith the incoming connections are all needed to be changed. For jth output unit, the difference is <em>y<\/em>j-<em>o<\/em>j. The error is calculated by multiplying this value <em>w<\/em>ith <em>o<\/em>j and (1- <em>o<\/em>j)1. The error is denoted by \u03b42 (Error at second weight layer). The subscript to that \u03b42 indicates the unit of the output layer.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><em>\"1\u00a0 Explanation to this multiplication is beyond the scope of this discussion. You can refer any book on BPNN for further discussion.\"<\/em><\/p>\r\n\r\n<\/div>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"text-align: initial; font-size: 1em;\">Thus the error at output unit j is = \u03b42j = (<\/span><em style=\"text-align: initial; font-size: 1em;\">y<\/em><span style=\"text-align: initial; font-size: 1em;\">j-<\/span><em style=\"text-align: initial; font-size: 1em;\">o<\/em><span style=\"text-align: initial; font-size: 1em;\">j) * <\/span><em style=\"text-align: initial; font-size: 1em;\">o<\/em><span style=\"text-align: initial; font-size: 1em;\">j * (1- <\/span><em style=\"text-align: initial; font-size: 1em;\">o<\/em><span style=\"text-align: initial; font-size: 1em;\">j). Now let us look at the difference made at hidden layer.<\/span><\/p>\r\n\r\n<div style=\"text-align: justify;\">\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify;\">Let us try to calculate error at <em>h<\/em>1. The h1 hidden unit is connected to all <em>o<\/em>j (for all j from 1 to m). Each oj has \u03b42j error associated with it. All lines that bring the errors back to h1 is shown in the figure 11.1 as boldface.<\/p>\r\n&nbsp;\r\n\r\nThe summation of all errors and associated weights for a hidden unit h1 is found as follows\r\n\r\n&nbsp;\r\n\r\n= <em>w2<\/em>11 * error at <em>o<\/em>1 + <em>w2<\/em>12 * error at <em>o<\/em>2 +W213 * error at <em>o<\/em>3 + <em>w2<\/em>14 * error at <em>o<\/em>4+ \u2026. + <em>w2<\/em>1l * error at <em>o<\/em>l(\r\n\r\n&nbsp;\r\n\r\n= \u2211\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a02\u00a0\u00a0 \u00a0* \u03b42j\r\n\r\n&nbsp;\r\n\r\nThe error at hidden unit <em>h<\/em>1 is therefore\r\n\r\n&nbsp;\r\n\r\n= <em>h<\/em>1 * (1 - <em>h<\/em>1) \u2211\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a02\u00a0\u00a0 \u00a0* \u03b42j\r\n\r\n&nbsp;\r\n\r\nThus for ith hidden unit, the error is denoted as \u03b41i and is calculated as\r\n\r\n\u03b41i = <em>h<\/em>i * (1 - <em>h<\/em>i) \u2211\u00a0 \u00a0 \u00a02\u00a0\u00a0 \u00a0* \u03b42<sub>j<\/sub>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify;\">Once the errors are calculated, one must think of updating the weights. We do not really need to <em>w<\/em>orry about reducing or incrementing weights as the sign of error itself determines that. For example if (<em>y<\/em><sub>j<\/sub>-<em>o<\/em><sub>j<\/sub>) is positive, <em>w<\/em>e need to decrease the weights and increase otherwise. The other values that <em>w<\/em>e multiply <em>o<\/em><sub>j<\/sub> * (1- <em>o<\/em>j) is always negative and thus the multiplication (<em>y<\/em><sub>j<\/sub>-<em>o<\/em><sub>j<\/sub>) * <em>o<\/em><sub>j<\/sub> * (1- <em>o<\/em><sub>j<\/sub>) is positive when the weights are to be increased and negative when the weights to be decreased. That means, when the weight update is done, these values can be used as it is.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">Thus the weight update is done using the errors associated <em>w<\/em>ith each weight. The error in the second layer (w<sub>2<\/sub>), is coming from the hidden unit and in the first layer (w<sub>1<\/sub>) from the input unit.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">For example updates at <em>w2<\/em><sub>11<\/sub>\u00a0 is based on the h<sub>1<\/sub>\u00a0 (the place from activation begins) and the error at <em>o<\/em><sub>1<\/sub> is \u03b42<sub>1<\/sub> (Where the activation ends).<\/p>\r\n&nbsp;\r\n\r\nSo weight update at <em>w2<\/em><sub>11<\/sub> is based on <em>h<\/em><sub>1<\/sub> * \u03b42<sub>1<\/sub>\r\n\r\n&nbsp;\r\n\r\nSimilarly weight update at <em>w2<\/em>ij is based on <em>h<\/em>i * \u03b42j \/\/ note that the subscripts of <em>h <\/em>and \u03b42 are different\r\n\r\n&nbsp;\r\n\r\nThe weight updates are indicated as \u2206. Usually the weight update also includes the value called \u0273. So\r\n\r\nweight updates are <em>w<\/em>ritten as\r\n\r\n&nbsp;\r\n\r\n\u2206 <em>w2<\/em>ij = \u0273 * hi * \u03b42j\r\n\r\n<\/div>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"text-align: initial; font-size: 1em;\">The symbol \u0273 is known as the learning rate. Its value is kept in the range of 0.3 to 0.4<sup>2<\/sup>. Thus\u00a0<\/span><span style=\"text-align: initial; font-size: 1em;\">New <\/span><em style=\"text-align: initial; font-size: 1em;\">w2<\/em><span style=\"text-align: initial; font-size: 1em;\">ij = Old <\/span><em style=\"text-align: initial; font-size: 1em;\">w2<\/em><span style=\"text-align: initial; font-size: 1em;\">ij \u00a0+ \u2206 <\/span><em style=\"text-align: initial; font-size: 1em;\">w2<\/em><span style=\"text-align: initial; font-size: 1em;\">ij<\/span><\/p>\r\n\r\n<div style=\"text-align: justify;\">\r\n\r\n&nbsp;\r\n\r\nAn update is usually also multiplied with a value called momentum factor \u03b1 which is kept at 0.9 after a few iterations. In the initial few iterations, the value is kept very law, 0.1 usually.\r\n\r\n&nbsp;\r\n\r\nNew <em>w2<\/em>ij = Old <em>w2<\/em>ij \u00a0+ \u03b1 * \u2206 <em>w2<\/em>ij\r\n\r\n&nbsp;\r\n\r\nSimilarly updates at the first layer involves initiators at the first activation layer, <em>x<\/em>i and also terminators at the hidden layer for each weight and weight updates are <em>w<\/em>ritten as\r\n\r\n&nbsp;\r\n\r\n\u2206 <em>w1<\/em>ij = \u0273 * <em>x<\/em>i * \u03b41j Thus\r\n\r\nNew <em>w1<\/em>ij = Old <em>w1<\/em>ij \u00a0+ \u2206 <em>w1<\/em>ij\r\n\r\n&nbsp;\r\n\r\nNew <em>w1<\/em>ij = Old <em>w1<\/em>ij \u00a0+ \u03b1 * \u2206 <em>w1<\/em>ij (considering momentum factor)\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify;\">Once these weight updates are applied, one epoch is said to be over. Multiple epochs (thousands of them in most cases) are required in getting the set of weights <em>w<\/em>hich can classify all the inputs correctly. If <em>w<\/em>e do not get one set, <em>w<\/em>e may need to start all over again as there is no guarantee that <em>w<\/em>e <em>w<\/em>ill always get that weight vector.<\/p>\r\n&nbsp;\r\n\r\n<em>2\u00a0 The values like learning rate and momentum rate etc are found empirically, researchers tries a few values and whichever value gives better performance with lesser overhead is used.<\/em>\r\n\r\n<\/div>\r\n<div style=\"text-align: justify;\">\r\n\r\n<img class=\"size-full wp-image-92 aligncenter\" src=\"http:\/\/itp6.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/31\/2018\/07\/error-calculation.jpg\" alt=\"\" width=\"667\" height=\"414\" \/>\r\n<p style=\"text-align: center;\">Figure 11.1 The error calculation back at hidden layer based on error found at output layer.<\/p>\r\n&nbsp;\r\n\r\n<strong>The steps of the algorithm<\/strong>\r\n\r\n&nbsp;\r\n\r\nLet us briefly list the steps of the algorithm for training.\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify;\">1. Decide about neurons for each layer, input and output first and then hidden as a geometrical mean of both values<\/p>\r\n<p style=\"text-align: justify;\">2. Initialize each matrix of weights with random weights of small values for example -0.1 and +0.1 or between 0.05 and -0.05. The idea of keeping the values small is that the larger weights are found to start dominating and bias the output. Keeping them small helps them to learn in a more unbiased way.<\/p>\r\n3. Epoch = 1;\r\n\r\n4. Pick up first input\r\n\r\n5. Provide the input to each <em>x<\/em>i, and calculate each <em>h<\/em>i as well as <em>o<\/em>i based on the input.\r\n\r\n6. Get correct output for that input, call it <em>y<\/em>j.\r\n\r\n7. Find out error \u03b42 based on equation 10.13 for each activation <em>h<\/em>i.\r\n\r\n8. Find out error \u03b41 based on equation 10.2 for each activation <em>x<\/em>i\r\n\r\n9. If the error is less than tolerance level mark that this weight is learned and go to 11\r\n\r\n10. Find out \u2206 <em>w2<\/em>ij and \u2206 <em>w1<\/em>ij and update weights accordingly.\r\n\r\n<span style=\"text-align: initial; font-size: 1em;\">11. If there is another input, take it and go to 5.<\/span>\r\n\r\n<span style=\"text-align: initial; font-size: 1em;\">12. This state is reached when all inputs are processed<\/span>\r\n\r\n<span style=\"text-align: initial; font-size: 1em;\">13. Epoch value is incremented by 1<\/span>\r\n\r\n<span style=\"text-align: initial; font-size: 1em;\">14. If Epoch value is more than reasonable (different for different case), the network is not learning, stop and restart the process from the beginning.<\/span>\r\n\r\n<span style=\"text-align: initial; font-size: 1em;\">15. If there is any weight which is not learned, pick up first input again and go to 5.<\/span>\r\n\r\n<span style=\"text-align: initial; font-size: 1em;\">16. Otherwise store the weight matrices and ready for testing. <\/span>\r\n\r\n&nbsp;\r\n\r\n<span style=\"text-align: initial; font-size: 1em;\">Now let us write down the algorithm for testing<\/span>\r\n\r\n<\/div>\r\n<div style=\"text-align: justify;\">\r\n\r\n&nbsp;\r\n\r\n1. Populate the weight matrix with weights learned during the training process\r\n\r\n2. Take the first testing input.\r\n\r\n3. Provide that input and see what the output is. Now we use a different tolerance level, normally it is such that if a value is &gt; 0.5 it is considered 1 and if it is less than 0.5 it is considered 0.\r\n\r\n4. Display the output. There is no updating of weights for testing inputs.\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><strong>Geometrical view of the learning process<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">If one would like to view this process geometrically, it is about finding out a line in a plane <em>w<\/em>hich separates two classes. If there are multiple classes, <em>w<\/em>e need multiple lines to segregate the plane in segments <em>w<\/em>hich correctly divides the plane into classes <em>w<\/em>e <em>w<\/em>ant. For example if assume face recognition process, <em>w<\/em>e might have a plane <em>w<\/em>ith some weight values as mentioned in figure 11.2. Multiple lines represent typical sequence of neurons. The combination of weights represent <em>m <\/em>and c values in a conventional y = mx+ c equation of line. Thus some weights represent the slope of the line and some other represents the intersection on Y axis.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-91 aligncenter\" src=\"http:\/\/itp6.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/31\/2018\/07\/Different-regions.jpg\" alt=\"\" width=\"424\" height=\"272\" \/>\r\n<p style=\"text-align: center;\">Figure 11.2 Different regions separated in classes by different lines<\/p>\r\n\r\n<\/div>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><span style=\"text-align: initial; font-size: 1em;\">The figure 11.2 represents a case <\/span><em style=\"text-align: initial; font-size: 1em;\">w<\/em><span style=\"text-align: initial; font-size: 1em;\">here the correct weights for all lines are found and thus those lines are able to divide each region correctly4.<\/span><\/p>\r\n\r\n<div style=\"text-align: justify;\">\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify;\">Starting <em>w<\/em>ith random weights means <em>w<\/em>e are drawing an arbitrary line in the plane. Changing weights using back propagation algorithm means <em>w<\/em>e are changing weights in a way that the new line separates the classes better than previous case.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">In fact, <em>w<\/em>hen <em>w<\/em>e are using multiple neurons in a single layer, it represents an <em>n<\/em>-dimensional plane where another <em>n<\/em>-1 dimensional plane or multiple planes are used to segregate different classes. In AI parlance, this plane (or a line in a previous case and in figure 11.2) is called <strong>a decision surface<\/strong>.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">The back propagation algorithm, in short, is to find one or multiple decision surfaces of dimension <em>n<\/em>-1 for correctly segregating each class in an <em>n <\/em>dimensional plane.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><strong>Content addressability and Hopfield networks<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">Though most neural networks are used for classification, many other proposals are made to use them in other cases. An important use of neural network is in the field of content addressability. Let us take an example to understand. We have usually seen byte storing 8 bits and designed to take any combination to store any sequence of eight bits from 00000000 to 11111111. The example that we used for content addressability that is described here use same eight bits but little differently. Here a neuron is used to store a bit and each neuron is connected <em>w<\/em>ith other neuron <em>w<\/em>ith some weight. Each neuron is assigned\u00a0<span style=\"text-align: initial; font-size: 1em;\">some value in the beginning. Once the values are assigned, each neuron calculates the \u2211i= n\u00a0<\/span><em style=\"text-align: initial; font-size: 1em;\">w<\/em><span style=\"text-align: initial; font-size: 1em;\">here\u00a0<\/span><em style=\"font-size: 1em; text-align: initial;\">n <\/em><span style=\"font-size: 1em; text-align: initial;\">is total number of other neurons connected to it, <\/span><em style=\"font-size: 1em; text-align: initial;\">x<\/em><span style=\"font-size: 1em; text-align: initial;\">i is the value of that neuron and <\/span><em style=\"font-size: 1em; text-align: initial;\">w<\/em><span style=\"font-size: 1em; text-align: initial;\">i is the weight connecting the neuron. For example the last neuron in the figure 11.3 is connected to 5th and 6th neuron. It will inhibit the 5th neuron by 5 while exhibit the 6th neuron by 2. The 5th neuron is 1 so sets the last neuron to zero. The 6th unit on the contrary receive positive input from that neuron but it has a strong inhibition (-2 from second neuron and -5 from 4th neuron) and the total comes out to be negative thus it resort to 0.<\/span><\/p>\r\n\r\n<\/div>\r\n<div style=\"text-align: justify;\">\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify;\">In fact only based on this connection information a few values are possible to be stored by network shown in figure 11.3. For example if <em>w<\/em>e begin <em>w<\/em>ith 11111111, the network will settle down into one of the few stable states. The state it settles into depends on which units are activated from the list. If we take a left to right route for example, it works like this.<\/p>\r\n&nbsp;\r\n\r\nThe first unit becomes active (the first 1) <em>w<\/em>hich actives the fourth neuron. It also inhibits third neuron, thus it makes it\r\n\r\n&nbsp;\r\n\r\n1_01 _ _ _ _\r\n\r\n&nbsp;\r\n\r\n<span style=\"text-align: initial; font-size: 1em;\">Now the second unit becomes active (second 1), it activates unit 7 and inhibits unit no 6. Thus after that the value is<\/span>\r\n\r\n<\/div>\r\n<div style=\"text-align: justify;\">\r\n\r\n&nbsp;\r\n\r\n1101_ 01_\r\n\r\n&nbsp;\r\n\r\nNow next is fifth unit, it is turned on than it is one and now the eighth unit <em>w<\/em>ill be zero, as 5th unit inhibits it. The result is\r\n\r\n&nbsp;\r\n\r\n11011010\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify;\">Thus even if the input is incorrect (not stable form), the output is in stable form. You can try a few other combinations and can see that only a few possible options possible for that network to settle into. One more option available <em>w<\/em>ith the above case is, <em>w<\/em>e just assume first two units are activated and then the last one is activated. You can get eighth unit on before the fifth and it exhibits the fifth neuron and result is<\/p>\r\n&nbsp;\r\n\r\n1101<strong>0<\/strong>01<strong>1<\/strong>\r\n\r\n&nbsp;\r\n\r\nYou can see two bits are different in this another stable state.\r\n\r\n&nbsp;\r\n\r\nOne typical stable state is surprisingly 00000000, all zeros. You can easily see that any other case also has that as a stable state.\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify;\">You may be wondering what <em>w<\/em>e are trying achieve by doing seemingly <em>w<\/em>asteful exercise. Eight neurons, <em>w<\/em>hich in true sense are capable of storing 28 values, are restricted to store much lesser (which one can count on finger tips usually), <em>w<\/em>ith additional weights and so on.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">We are trying to demonstrate a type of network called Hopfield <em>w<\/em>ith the ability to content address. Content addressability, if you remember, is the ability of network to get some part of data and get complete data. For example listening a few bars of music and get the entire song. Here <em>w<\/em>e have provided a few activations and we received activations from all other units. Quite similar to looking at part of the face and recognize the face. You can assume each neuron indicating a feature, an arc as a relationship between features weights as strength of that relation. For face recognition from a partial image, such networks can be used. For some information (some part of that can even be <em>w<\/em>rong! For example a big fish <em>w<\/em>hich comes often to the surface and throws <em>w<\/em>ater up like a fountain may be a query. The features are fish, fountain of water, being big in size and coming on surface regularly. All of this might get you an answer called <em>w<\/em>hale. You may have noticed that <em>w<\/em>e have an incorrect input (fish), <em>w<\/em>hale is not a fish but a mammal but <em>w<\/em>e still can get the right answer. In the case of figure 11.3 also, if <em>w<\/em>e give 1110 as an input for example, the first two <em>w<\/em>ill set the next two and <em>w<\/em>e <em>w<\/em>ill get 1101 and the rest based on the input. This is content addressability Hopfield networks are designed to provide. In our trivial examples <em>w<\/em>e have looked only at 8 such neurons, in real <em>w<\/em>orld case there may be thousands of neurons5.<\/p>\r\n\r\n<\/div>\r\n<p style=\"text-align: justify;\"><img class=\"size-full wp-image-90 aligncenter\" src=\"http:\/\/itp6.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/31\/2018\/07\/Content-Addressability.jpg\" alt=\"\" width=\"599\" height=\"152\" \/><\/p>\r\n<p style=\"text-align: center;\">Figure 11.3 Content Addressability<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\"><strong>Summary<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify;\">The back propagation algorithm is usually applied to neural networks which are multilayer feed forward and complete. The usual neural network contains three layers, input, hidden and output. The input layer distributes the inputs to all hidden units, hidden units process them and distribute them to output units. The output units process them to generate outputs. Errors are calculated and propagated back. The weights between input and hidden and hidden and output units are changed accordingly. This process continues till the weights are set for every input correctly. The learning process basically divides inputs into output clusters so much so that every input is correct classified to a geometric region identified as a typical output. Another type of neural network is known as Hopfield networks which are able to help content addressability that means setting a small fraction of the pattern generates complete pattern.<\/p>\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td><strong>you can view video on Learning process in BPNN and Hopfield networks<\/strong><\/td>\r\n<td><a href=\"https:\/\/youtu.be\/2k0pk8CMppE\" target=\"_blank\" rel=\"noopener\"><img class=\"alignnone wp-image-120\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"\" width=\"36\" height=\"36\" \/><\/a><\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>","rendered":"<div><span style=\"float: right;\"><a href=\"https:\/\/youtu.be\/2k0pk8CMppE\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"epgp books\" width=\"75px\" height=\"75px;\" \/><\/a><br \/>\n<\/span><\/div>\n<div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><strong>Introduction<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">This module extends the discussion that we started in the previous module. We looked at how multilayer perceptrons or multilayer networks can be designed and how the activations are calculated for the input. Now we will see how learning is done and how weights are updated in BPNN. We will also see how Hopfield networks are used for content addressability in this module.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><strong>Learning in Back Propagation network<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Back propagation network or BPNN is a neural network for which learning we can apply back propagation algorithm. The figure 10.5 that we have seen in previous module is an example of back propagation network. The back propagation network is popularly known as BPNN.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">The forward activations (<em>h<\/em>i and <em>o<\/em>j) are calculated based on sigmoid activation function. Once the output is received for a given input, the weights must be adjusted for making sure better output is achieved next time. We have already seen that adjustment of weight is decided based on the error that we received. The output is a real value between 0 and 1 and the required value is either 0 or 1. For example if for a given face, the correct output is 0,0,0,0,1,1, and we might get 0.10, 0.01, 0.92,0.25,0.92,0.87 as the output (considering two digits after the decimal point and truncating the output accordingly) of each layer. Now the difference at each unit can be calculated as 0.10, 0.01, 0.92, 0.25, 0.08, 0.13 (the difference between actual values calculated and required output) Now we decide what our tolerance level is. Suppose if our tolerance level is 0.10, three units have correctly learned (their difference is less than or equal to 0.10) while the rest are still to be learned. Their weights are to be reduced if they are positively misclassified or increased otherwise. Look at output units 1 and 2, both of them are learned so do not require additional learning. So no weight update takes place for them. Look at the third unit. It should output 0 but provides 0.92 and thus the weights associated to the lines connecting to output unit 3 (o3) must be reduced. Similarly output unit 5 must increase its weights a little further.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">The only issue now is to find out the exact values of weights to be increased or decreased for each erring input. For that, let us assume that <em>o<\/em>j is the output received and <em>y<\/em>j is the actual output received. The weights associated <em>w<\/em>ith the incoming connections are all needed to be changed. For jth output unit, the difference is <em>y<\/em>j-<em>o<\/em>j. The error is calculated by multiplying this value <em>w<\/em>ith <em>o<\/em>j and (1- <em>o<\/em>j)1. The error is denoted by \u03b42 (Error at second weight layer). The subscript to that \u03b42 indicates the unit of the output layer.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><em>&#8220;1\u00a0 Explanation to this multiplication is beyond the scope of this discussion. You can refer any book on BPNN for further discussion.&#8221;<\/em><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"text-align: initial; font-size: 1em;\">Thus the error at output unit j is = \u03b42j = (<\/span><em style=\"text-align: initial; font-size: 1em;\">y<\/em><span style=\"text-align: initial; font-size: 1em;\">j-<\/span><em style=\"text-align: initial; font-size: 1em;\">o<\/em><span style=\"text-align: initial; font-size: 1em;\">j) * <\/span><em style=\"text-align: initial; font-size: 1em;\">o<\/em><span style=\"text-align: initial; font-size: 1em;\">j * (1- <\/span><em style=\"text-align: initial; font-size: 1em;\">o<\/em><span style=\"text-align: initial; font-size: 1em;\">j). Now let us look at the difference made at hidden layer.<\/span><\/p>\n<div style=\"text-align: justify;\">\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Let us try to calculate error at <em>h<\/em>1. The h1 hidden unit is connected to all <em>o<\/em>j (for all j from 1 to m). Each oj has \u03b42j error associated with it. All lines that bring the errors back to h1 is shown in the figure 11.1 as boldface.<\/p>\n<p>&nbsp;<\/p>\n<p>The summation of all errors and associated weights for a hidden unit h1 is found as follows<\/p>\n<p>&nbsp;<\/p>\n<p>= <em>w2<\/em>11 * error at <em>o<\/em>1 + <em>w2<\/em>12 * error at <em>o<\/em>2 +W213 * error at <em>o<\/em>3 + <em>w2<\/em>14 * error at <em>o<\/em>4+ \u2026. + <em>w2<\/em>1l * error at <em>o<\/em>l(<\/p>\n<p>&nbsp;<\/p>\n<p>= \u2211\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a02\u00a0\u00a0 \u00a0* \u03b42j<\/p>\n<p>&nbsp;<\/p>\n<p>The error at hidden unit <em>h<\/em>1 is therefore<\/p>\n<p>&nbsp;<\/p>\n<p>= <em>h<\/em>1 * (1 &#8211; <em>h<\/em>1) \u2211\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a02\u00a0\u00a0 \u00a0* \u03b42j<\/p>\n<p>&nbsp;<\/p>\n<p>Thus for ith hidden unit, the error is denoted as \u03b41i and is calculated as<\/p>\n<p>\u03b41i = <em>h<\/em>i * (1 &#8211; <em>h<\/em>i) \u2211\u00a0 \u00a0 \u00a02\u00a0\u00a0 \u00a0* \u03b42<sub>j<\/sub><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Once the errors are calculated, one must think of updating the weights. We do not really need to <em>w<\/em>orry about reducing or incrementing weights as the sign of error itself determines that. For example if (<em>y<\/em><sub>j<\/sub>&#8211;<em>o<\/em><sub>j<\/sub>) is positive, <em>w<\/em>e need to decrease the weights and increase otherwise. The other values that <em>w<\/em>e multiply <em>o<\/em><sub>j<\/sub> * (1- <em>o<\/em>j) is always negative and thus the multiplication (<em>y<\/em><sub>j<\/sub>&#8211;<em>o<\/em><sub>j<\/sub>) * <em>o<\/em><sub>j<\/sub> * (1- <em>o<\/em><sub>j<\/sub>) is positive when the weights are to be increased and negative when the weights to be decreased. That means, when the weight update is done, these values can be used as it is.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Thus the weight update is done using the errors associated <em>w<\/em>ith each weight. The error in the second layer (w<sub>2<\/sub>), is coming from the hidden unit and in the first layer (w<sub>1<\/sub>) from the input unit.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">For example updates at <em>w2<\/em><sub>11<\/sub>\u00a0 is based on the h<sub>1<\/sub>\u00a0 (the place from activation begins) and the error at <em>o<\/em><sub>1<\/sub> is \u03b42<sub>1<\/sub> (Where the activation ends).<\/p>\n<p>&nbsp;<\/p>\n<p>So weight update at <em>w2<\/em><sub>11<\/sub> is based on <em>h<\/em><sub>1<\/sub> * \u03b42<sub>1<\/sub><\/p>\n<p>&nbsp;<\/p>\n<p>Similarly weight update at <em>w2<\/em>ij is based on <em>h<\/em>i * \u03b42j \/\/ note that the subscripts of <em>h <\/em>and \u03b42 are different<\/p>\n<p>&nbsp;<\/p>\n<p>The weight updates are indicated as \u2206. Usually the weight update also includes the value called \u0273. So<\/p>\n<p>weight updates are <em>w<\/em>ritten as<\/p>\n<p>&nbsp;<\/p>\n<p>\u2206 <em>w2<\/em>ij = \u0273 * hi * \u03b42j<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"text-align: initial; font-size: 1em;\">The symbol \u0273 is known as the learning rate. Its value is kept in the range of 0.3 to 0.4<sup>2<\/sup>. Thus\u00a0<\/span><span style=\"text-align: initial; font-size: 1em;\">New <\/span><em style=\"text-align: initial; font-size: 1em;\">w2<\/em><span style=\"text-align: initial; font-size: 1em;\">ij = Old <\/span><em style=\"text-align: initial; font-size: 1em;\">w2<\/em><span style=\"text-align: initial; font-size: 1em;\">ij \u00a0+ \u2206 <\/span><em style=\"text-align: initial; font-size: 1em;\">w2<\/em><span style=\"text-align: initial; font-size: 1em;\">ij<\/span><\/p>\n<div style=\"text-align: justify;\">\n<p>&nbsp;<\/p>\n<p>An update is usually also multiplied with a value called momentum factor \u03b1 which is kept at 0.9 after a few iterations. In the initial few iterations, the value is kept very law, 0.1 usually.<\/p>\n<p>&nbsp;<\/p>\n<p>New <em>w2<\/em>ij = Old <em>w2<\/em>ij \u00a0+ \u03b1 * \u2206 <em>w2<\/em>ij<\/p>\n<p>&nbsp;<\/p>\n<p>Similarly updates at the first layer involves initiators at the first activation layer, <em>x<\/em>i and also terminators at the hidden layer for each weight and weight updates are <em>w<\/em>ritten as<\/p>\n<p>&nbsp;<\/p>\n<p>\u2206 <em>w1<\/em>ij = \u0273 * <em>x<\/em>i * \u03b41j Thus<\/p>\n<p>New <em>w1<\/em>ij = Old <em>w1<\/em>ij \u00a0+ \u2206 <em>w1<\/em>ij<\/p>\n<p>&nbsp;<\/p>\n<p>New <em>w1<\/em>ij = Old <em>w1<\/em>ij \u00a0+ \u03b1 * \u2206 <em>w1<\/em>ij (considering momentum factor)<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Once these weight updates are applied, one epoch is said to be over. Multiple epochs (thousands of them in most cases) are required in getting the set of weights <em>w<\/em>hich can classify all the inputs correctly. If <em>w<\/em>e do not get one set, <em>w<\/em>e may need to start all over again as there is no guarantee that <em>w<\/em>e <em>w<\/em>ill always get that weight vector.<\/p>\n<p>&nbsp;<\/p>\n<p><em>2\u00a0 The values like learning rate and momentum rate etc are found empirically, researchers tries a few values and whichever value gives better performance with lesser overhead is used.<\/em><\/p>\n<\/div>\n<div style=\"text-align: justify;\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-92 aligncenter\" src=\"http:\/\/itp6.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/31\/2018\/07\/error-calculation.jpg\" alt=\"\" width=\"667\" height=\"414\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/error-calculation.jpg 667w, https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/error-calculation-300x186.jpg 300w, https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/error-calculation-65x40.jpg 65w, https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/error-calculation-225x140.jpg 225w, https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/error-calculation-350x217.jpg 350w\" sizes=\"auto, (max-width: 667px) 100vw, 667px\" \/><\/p>\n<p style=\"text-align: center;\">Figure 11.1 The error calculation back at hidden layer based on error found at output layer.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>The steps of the algorithm<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Let us briefly list the steps of the algorithm for training.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">1. Decide about neurons for each layer, input and output first and then hidden as a geometrical mean of both values<\/p>\n<p style=\"text-align: justify;\">2. Initialize each matrix of weights with random weights of small values for example -0.1 and +0.1 or between 0.05 and -0.05. The idea of keeping the values small is that the larger weights are found to start dominating and bias the output. Keeping them small helps them to learn in a more unbiased way.<\/p>\n<p>3. Epoch = 1;<\/p>\n<p>4. Pick up first input<\/p>\n<p>5. Provide the input to each <em>x<\/em>i, and calculate each <em>h<\/em>i as well as <em>o<\/em>i based on the input.<\/p>\n<p>6. Get correct output for that input, call it <em>y<\/em>j.<\/p>\n<p>7. Find out error \u03b42 based on equation 10.13 for each activation <em>h<\/em>i.<\/p>\n<p>8. Find out error \u03b41 based on equation 10.2 for each activation <em>x<\/em>i<\/p>\n<p>9. If the error is less than tolerance level mark that this weight is learned and go to 11<\/p>\n<p>10. Find out \u2206 <em>w2<\/em>ij and \u2206 <em>w1<\/em>ij and update weights accordingly.<\/p>\n<p><span style=\"text-align: initial; font-size: 1em;\">11. If there is another input, take it and go to 5.<\/span><\/p>\n<p><span style=\"text-align: initial; font-size: 1em;\">12. This state is reached when all inputs are processed<\/span><\/p>\n<p><span style=\"text-align: initial; font-size: 1em;\">13. Epoch value is incremented by 1<\/span><\/p>\n<p><span style=\"text-align: initial; font-size: 1em;\">14. If Epoch value is more than reasonable (different for different case), the network is not learning, stop and restart the process from the beginning.<\/span><\/p>\n<p><span style=\"text-align: initial; font-size: 1em;\">15. If there is any weight which is not learned, pick up first input again and go to 5.<\/span><\/p>\n<p><span style=\"text-align: initial; font-size: 1em;\">16. Otherwise store the weight matrices and ready for testing. <\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-align: initial; font-size: 1em;\">Now let us write down the algorithm for testing<\/span><\/p>\n<\/div>\n<div style=\"text-align: justify;\">\n<p>&nbsp;<\/p>\n<p>1. Populate the weight matrix with weights learned during the training process<\/p>\n<p>2. Take the first testing input.<\/p>\n<p>3. Provide that input and see what the output is. Now we use a different tolerance level, normally it is such that if a value is &gt; 0.5 it is considered 1 and if it is less than 0.5 it is considered 0.<\/p>\n<p>4. Display the output. There is no updating of weights for testing inputs.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><strong>Geometrical view of the learning process<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">If one would like to view this process geometrically, it is about finding out a line in a plane <em>w<\/em>hich separates two classes. If there are multiple classes, <em>w<\/em>e need multiple lines to segregate the plane in segments <em>w<\/em>hich correctly divides the plane into classes <em>w<\/em>e <em>w<\/em>ant. For example if assume face recognition process, <em>w<\/em>e might have a plane <em>w<\/em>ith some weight values as mentioned in figure 11.2. Multiple lines represent typical sequence of neurons. The combination of weights represent <em>m <\/em>and c values in a conventional y = mx+ c equation of line. Thus some weights represent the slope of the line and some other represents the intersection on Y axis.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-91 aligncenter\" src=\"http:\/\/itp6.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/31\/2018\/07\/Different-regions.jpg\" alt=\"\" width=\"424\" height=\"272\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/Different-regions.jpg 424w, https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/Different-regions-300x192.jpg 300w, https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/Different-regions-65x42.jpg 65w, https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/Different-regions-225x144.jpg 225w, https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/Different-regions-350x225.jpg 350w\" sizes=\"auto, (max-width: 424px) 100vw, 424px\" \/><\/p>\n<p style=\"text-align: center;\">Figure 11.2 Different regions separated in classes by different lines<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"text-align: initial; font-size: 1em;\">The figure 11.2 represents a case <\/span><em style=\"text-align: initial; font-size: 1em;\">w<\/em><span style=\"text-align: initial; font-size: 1em;\">here the correct weights for all lines are found and thus those lines are able to divide each region correctly4.<\/span><\/p>\n<div style=\"text-align: justify;\">\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Starting <em>w<\/em>ith random weights means <em>w<\/em>e are drawing an arbitrary line in the plane. Changing weights using back propagation algorithm means <em>w<\/em>e are changing weights in a way that the new line separates the classes better than previous case.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">In fact, <em>w<\/em>hen <em>w<\/em>e are using multiple neurons in a single layer, it represents an <em>n<\/em>-dimensional plane where another <em>n<\/em>-1 dimensional plane or multiple planes are used to segregate different classes. In AI parlance, this plane (or a line in a previous case and in figure 11.2) is called <strong>a decision surface<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">The back propagation algorithm, in short, is to find one or multiple decision surfaces of dimension <em>n<\/em>-1 for correctly segregating each class in an <em>n <\/em>dimensional plane.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><strong>Content addressability and Hopfield networks<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Though most neural networks are used for classification, many other proposals are made to use them in other cases. An important use of neural network is in the field of content addressability. Let us take an example to understand. We have usually seen byte storing 8 bits and designed to take any combination to store any sequence of eight bits from 00000000 to 11111111. The example that we used for content addressability that is described here use same eight bits but little differently. Here a neuron is used to store a bit and each neuron is connected <em>w<\/em>ith other neuron <em>w<\/em>ith some weight. Each neuron is assigned\u00a0<span style=\"text-align: initial; font-size: 1em;\">some value in the beginning. Once the values are assigned, each neuron calculates the \u2211i= n\u00a0<\/span><em style=\"text-align: initial; font-size: 1em;\">w<\/em><span style=\"text-align: initial; font-size: 1em;\">here\u00a0<\/span><em style=\"font-size: 1em; text-align: initial;\">n <\/em><span style=\"font-size: 1em; text-align: initial;\">is total number of other neurons connected to it, <\/span><em style=\"font-size: 1em; text-align: initial;\">x<\/em><span style=\"font-size: 1em; text-align: initial;\">i is the value of that neuron and <\/span><em style=\"font-size: 1em; text-align: initial;\">w<\/em><span style=\"font-size: 1em; text-align: initial;\">i is the weight connecting the neuron. For example the last neuron in the figure 11.3 is connected to 5th and 6th neuron. It will inhibit the 5th neuron by 5 while exhibit the 6th neuron by 2. The 5th neuron is 1 so sets the last neuron to zero. The 6th unit on the contrary receive positive input from that neuron but it has a strong inhibition (-2 from second neuron and -5 from 4th neuron) and the total comes out to be negative thus it resort to 0.<\/span><\/p>\n<\/div>\n<div style=\"text-align: justify;\">\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">In fact only based on this connection information a few values are possible to be stored by network shown in figure 11.3. For example if <em>w<\/em>e begin <em>w<\/em>ith 11111111, the network will settle down into one of the few stable states. The state it settles into depends on which units are activated from the list. If we take a left to right route for example, it works like this.<\/p>\n<p>&nbsp;<\/p>\n<p>The first unit becomes active (the first 1) <em>w<\/em>hich actives the fourth neuron. It also inhibits third neuron, thus it makes it<\/p>\n<p>&nbsp;<\/p>\n<p>1_01 _ _ _ _<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-align: initial; font-size: 1em;\">Now the second unit becomes active (second 1), it activates unit 7 and inhibits unit no 6. Thus after that the value is<\/span><\/p>\n<\/div>\n<div style=\"text-align: justify;\">\n<p>&nbsp;<\/p>\n<p>1101_ 01_<\/p>\n<p>&nbsp;<\/p>\n<p>Now next is fifth unit, it is turned on than it is one and now the eighth unit <em>w<\/em>ill be zero, as 5th unit inhibits it. The result is<\/p>\n<p>&nbsp;<\/p>\n<p>11011010<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Thus even if the input is incorrect (not stable form), the output is in stable form. You can try a few other combinations and can see that only a few possible options possible for that network to settle into. One more option available <em>w<\/em>ith the above case is, <em>w<\/em>e just assume first two units are activated and then the last one is activated. You can get eighth unit on before the fifth and it exhibits the fifth neuron and result is<\/p>\n<p>&nbsp;<\/p>\n<p>1101<strong>0<\/strong>01<strong>1<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>You can see two bits are different in this another stable state.<\/p>\n<p>&nbsp;<\/p>\n<p>One typical stable state is surprisingly 00000000, all zeros. You can easily see that any other case also has that as a stable state.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">You may be wondering what <em>w<\/em>e are trying achieve by doing seemingly <em>w<\/em>asteful exercise. Eight neurons, <em>w<\/em>hich in true sense are capable of storing 28 values, are restricted to store much lesser (which one can count on finger tips usually), <em>w<\/em>ith additional weights and so on.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">We are trying to demonstrate a type of network called Hopfield <em>w<\/em>ith the ability to content address. Content addressability, if you remember, is the ability of network to get some part of data and get complete data. For example listening a few bars of music and get the entire song. Here <em>w<\/em>e have provided a few activations and we received activations from all other units. Quite similar to looking at part of the face and recognize the face. You can assume each neuron indicating a feature, an arc as a relationship between features weights as strength of that relation. For face recognition from a partial image, such networks can be used. For some information (some part of that can even be <em>w<\/em>rong! For example a big fish <em>w<\/em>hich comes often to the surface and throws <em>w<\/em>ater up like a fountain may be a query. The features are fish, fountain of water, being big in size and coming on surface regularly. All of this might get you an answer called <em>w<\/em>hale. You may have noticed that <em>w<\/em>e have an incorrect input (fish), <em>w<\/em>hale is not a fish but a mammal but <em>w<\/em>e still can get the right answer. In the case of figure 11.3 also, if <em>w<\/em>e give 1110 as an input for example, the first two <em>w<\/em>ill set the next two and <em>w<\/em>e <em>w<\/em>ill get 1101 and the rest based on the input. This is content addressability Hopfield networks are designed to provide. In our trivial examples <em>w<\/em>e have looked only at 8 such neurons, in real <em>w<\/em>orld case there may be thousands of neurons5.<\/p>\n<\/div>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-90 aligncenter\" src=\"http:\/\/itp6.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/31\/2018\/07\/Content-Addressability.jpg\" alt=\"\" width=\"599\" height=\"152\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/Content-Addressability.jpg 599w, https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/Content-Addressability-300x76.jpg 300w, https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/Content-Addressability-65x16.jpg 65w, https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/Content-Addressability-225x57.jpg 225w, https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-content\/uploads\/sites\/31\/2018\/07\/Content-Addressability-350x89.jpg 350w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><\/p>\n<p style=\"text-align: center;\">Figure 11.3 Content Addressability<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><strong>Summary<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">The back propagation algorithm is usually applied to neural networks which are multilayer feed forward and complete. The usual neural network contains three layers, input, hidden and output. The input layer distributes the inputs to all hidden units, hidden units process them and distribute them to output units. The output units process them to generate outputs. Errors are calculated and propagated back. The weights between input and hidden and hidden and output units are changed accordingly. This process continues till the weights are set for every input correctly. The learning process basically divides inputs into output clusters so much so that every input is correct classified to a geometric region identified as a typical output. Another type of neural network is known as Hopfield networks which are able to help content addressability that means setting a small fraction of the pattern generates complete pattern.<\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>you can view video on Learning process in BPNN and Hopfield networks<\/strong><\/td>\n<td><a href=\"https:\/\/youtu.be\/2k0pk8CMppE\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-120\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"\" width=\"36\" height=\"36\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"author":4,"menu_order":11,"template":"","meta":{"_acf_changed":false,"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":["prof-bhushan-trivedi"],"pb_section_license":""},"chapter-type":[],"contributor":[58],"license":[],"class_list":["post-81","chapter","type-chapter","status-publish","hentry","contributor-prof-bhushan-trivedi"],"part":3,"_links":{"self":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-json\/pressbooks\/v2\/chapters\/81","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-json\/wp\/v2\/users\/4"}],"version-history":[{"count":6,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-json\/pressbooks\/v2\/chapters\/81\/revisions"}],"predecessor-version":[{"id":458,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-json\/pressbooks\/v2\/chapters\/81\/revisions\/458"}],"part":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-json\/pressbooks\/v2\/chapters\/81\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-json\/wp\/v2\/media?parent=81"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-json\/pressbooks\/v2\/chapter-type?post=81"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-json\/wp\/v2\/contributor?post=81"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/itp6\/wp-json\/wp\/v2\/license?post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}