The input and output layers are the only required layers
The above loop stores each neuron’s activation value in the same neuron. Each activation is determined by calling the act method of the Neuron. To see how each neuron calculates its activation we must first examine the Neuron class, which is shown in Listing 2.3.
Listing 2.3: The Neuron Class (Neuron.java)
*/
public int activation;/**
* The constructor. The weights between this neuron and * every other neuron(including itself) is passed in as * an array. Usually the weight between this neuron and * itself is zero.for ( i=0;i<x.length;i++ )
if ( x[i] )
a+=weightv[i];
return a;
}}
Summary
Neural Networks are one of the most commonly used systems in Artificial Intelligence.
This chapter showed how to construct a simple Hopfield Neural Network. The next chapter will show how to create a multi-layered neural network. To do this you will be introduced to the JOONE package that is freely available for Java.