[ Pobierz całość w formacie PDF ]
.Hamming DistanceWhen we talk about closeness of a bit pattern to another bit pattern, the Euclidean distance need not be considered.Instead, the Hamming distance can be used, which is much easier to determine, since it is the number of bit positions in which the two patterns being compared differ.Patterns being strings, the Hamming distance is more appropriate than the Euclidean distance.NOTE: The weight matrix W we gave in this example is not the only weight matrix that would enable the network to recall the patterns A and B correctly.You can see that if we replace each of 3 and 3 in the matrix by say, 2 and 2, respectively, the resulting matrix would also facilitate the same performance from the network.For more details, consult Chapter 4.Asynchronous UpdateThe Hopfield network is a recurrent network.This means that outputs from the network are fed back as inputs.This is not apparent from Figure 1.3, but is clearly seen from Figure 1.4.Figure 1.4 Feedback in the Hopfield network.The Hopfield network always stabilizes to a fixed point.There is a very important detail regarding the Hopfield network to achieve this stability.In the examples thus far, we have not had a problem getting a stable output from the network, so we have not presented this detail of network operation.This detail is the need to update the network asynchronously.This means that changes do not occur simultaneously to outputs that are fed back as inputs, but rather occur for one vector component at a time.The true operation of the Hopfield network follows the procedure below for input vector Invec and output vector Outvec:1. Apply an input, Invec, to the network, and initialize Outvec = Invec2. Start with i = 13. Calculate Valuei = DotProduct ( Inveci, Columni of Weight matrix)4. Calculate Outveci = f(Valuei) where f is the threshold function discussed previously5. Update the input to the network with component Outveci6. Increment i, and repeat steps 3, 4, 5, and 6 until Invec = Outvec (note that when i reaches its maximum value, it is then next reset to 1 for the cycle to continue)Now lets see how to apply this procedure.Building on the last example, we now input E = (1, 0, 0, 1), which is at an equal distance from A and B.Without applying the asynchronous procedure above, but instead using the shortcut procedure weve been using so far, you would get an output F = (0, 1, 1, 0).This vector, F, as subsequent input would result in E as the output.This is incorrect since the network oscillates between two states.We have updated the entire input vector synchronously.Now lets apply asynchronous update.For input E, (1,0,0,1) we arrive at the following results detailed for each update step, in Table 1.1.Table 1.1 Example of Asynchronous Update for the Hopfield NetworkStepiInvecColumn of Weight vectorValueOutvecnotes10011001initialization : set Outvec = Invec = Input pattern1110010 -3 3 -3-30001column 1 of Outvec changed to 0220001-3 0 -3 330101column 2 of Outvec changed to 13301013 -3 0 -3-60101column 3 of Outvec stays as 0440101-3 3 -3 030101column 4 of Outvec stays as 15101010 -3 3 -3-60101column 1 stable as 0620101-3 0 -3 330101column 2 stable as 17301013 -3 0 -3-60101column 3 stable as 0840101-3 3 -3 030101column 4 stable as 1; stable recalled pattern = 0101PreviousTable of ContentsNext | | Use of this site is subject to certain ,All rights reserved.Reproduction whole or in part in any form or medium without express written permision of EarthWeb is prohibited
[ Pobierz całość w formacie PDF ]