Pages

Sunday, December 18, 2011

The Hopfield Neural Network II

In this implementation of the Hopfield Neural Network, I designed the classes in a way that would make the network dynamic. By that I mean that the user can determine the size of the network during run-time of the program. Note that this post is a subsequent post to the original The Hopfield Neural Network I. Please refer to that post if you want to understand the internals of HNN.


Moreover, I decided that i will stick to the command-line interface since this is a dynamic application and it would be easier to create it in such an interface rather than to create the controls during run-time. Please note that there is one restriction and that is we can't create more than a 10 neuron neural net since the patterns are parsed to integers first and integers have specific sizes. I realized this late during the development and decided that I will fix this bug later because my intention was to demonstrate that the application can be dynamic.

Most importantly, the classes I added in this implementation are the Matrix.java, List.java and Node.java. Simple a Matrix type is nothing but a List of a Lists of Nodes. Each Node is an element or a cell in the Matrix, and each row is a List and the Matrix is a List of Lists.

Please take a look at the source code. Any suggestions and/or enhancements to the code are welcome.




No comments :

Post a Comment