简体   繁体   中英

training Hopefield network with encog in java

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) where aPattern is of type BasicMLData 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 then runUntilStable then getCurrentState to get output.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM