Now you will see how to make use of the HopfieldNetwork class that was created in the last section. The first example implements a simple console application that demonstrates basic pattern recognition. The second example graphically displays the weight matrix using a Java applet. Finally, the third example uses a Java applet to illustrate how a Hopfield neural network can be used to recognize a grid pattern.
The first example, which is a simple console application, is shown in Listing 3.2.
Listing 3.2: Simple Console Example (ConsoleHopfield.java)
Calais Document Category: