Network Shutdown?
Whenever I run my network (which I'm doing inside Eclipse Galileo 3.5.2 on a MacBookPro i7-620M) and it's done, it appears there are other threads still running because I have to hit the 'terminate' button in the console window after my program has ended. My program does other things and if I select any of those other options and then quit the program, I don't have to 'terminate' - it terminates as expected. Only when I run the network does it not fully shutdown. My network is quite simple (see below) so I'm wondering if maybe BasicNetwork needs a 'shutdown' method or is there something I'm not currently doing that I should be? Thanks
FeedForwardPattern ffp = new FeedForwardPattern();
ffp.setActivationFunction(new ActivationSigmoid());
ffp.setInputNeurons(neurons);
ffp.setOutputNeurons(neurons);
ffp.addHiddenLayer(neurons * 2);
BasicNetwork network = ffp.generate();
network.getStructure().finalizeStructure();
network = trainNetwork(network, rate, trainInput, trainIdeal); // this method calls train.finishTraining() when done
NeuralData output = network.compute(normalizeData(data, max));





It is due to the way Java's built in threadpool works, Java likes to hang onto threads even though the threadpool is no longer in use. Which is logical, since Java does not know if the threadpool is about to go back into use. Calling Encog.shutdown() will solve that.
I don't see an Encog.shutdown() method.
That is an Encog 2.5 function. You could call EncogConcurrency.shutdown and have the same effect. Basically the JDK threadpool hangs on to threads,even after we are no longer using it.
Thanks - that works. When is Encog 2.5 scheduled to release? Has it addressed any problems with Train.iteration() hanging intermittently?
Encog 2.5 is probably going to be this fall.
However, we are gearing up to release Encog 2.4.2 sometime next week. It will contain several bug fixes. This is a brief summary.
2.4.2: Added stress test
2.4.2: Fixed OpenCL threading issue.
2.4.2: Prune incramental to support elman/jordan
2.4.2: Pool items now pass on errors
2.4.2: Added shutdown method
2.4.2: Fixed pattern typos
2.4.2: Fixed many bugs in BufferedNeuralDataSet
2.4.2: Fixed bug where csv2binary had the number of columns hard-coded
I have not experianced Train.iteration hanging. Perhaps if one of the threads were to die. That is part of the purpose in "pool items now pass on errors". If an error happens in a thread, it will now be thrown in the main thread. Right now it would cause a thread to die, which could cause thread.iteration to hang.