Saving NEAT networks?

598 views Asked by At

In Java's version of Encog, how do I save a NEAT network and its training? I'd like to be able to close my software and resume its training where it left off the next time I run it.

I have a NEATPopluation, CalculateScore, and EvolutionaryAlgorithm training object. Which do I save and how do I reinitialize it properly?

I've read about persistence but none of the examples seem to be for this kind of network.

1

There are 1 answers

1
Pablo On

my understanding is that you have save your NEATPopulation using a PersistNEATPopulation instance. In fact it's the way I'm doing it, but maybe somebody with better knowledge can illustrate us.

I don't know how to do it in Java, but in .net I do something like this:

NEATNetwork network = (NEATNetwork)train.CODEC.Decode(train.BestGenome);

trainedNetworkFile = new FileStream(path, System.IO.FileMode.Create);
pnp = new PersistNEATPopulation();
pnp.Save(trainedNetworkFile, pop); //pop is your NEATPopulation object
trainedNetworkFile.Close();