I started working with this network. And I wrote some code, but I am not sure whether I am doing it right or not. here is what I do:
- First create the network
HopefieldNetwork net = new HopefieldNetwork(50)
. - Than add all patterns, with
net.addPattern(aPattern)
whereaPattern
is of typeBasicMLData
and changes in a loop to add all patterns. - Now do
net.runUntilStable(5000)
for training with 5000 iterations max. Is this right? - Now we have the trained network. Get output like
out = (BasicMLData) net.compute(input)
So is everything OK?
I found the solution.
You have to call
setCurrentState
thenrunUntilStable
thengetCurrentState
to get output.