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 C# application. Finally, the third example uses a C# application 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.