neat-python icon indicating copy to clipboard operation
neat-python copied to clipboard

Bug fix regarding checkpoint generation number

Open erupturatis opened this issue 3 years ago • 0 comments

Related to #132

When saving a checkpoint for a generation let's say n , we are not actually saving the last trained generation, we are saving the newly created generation based on generation n so therefore the generation n+1.

self.population = self.reproduction.reproduce(self.config, self.species, self.config.pop_size, self.generation) is before self.reporters.end_generation(self.config, self.population, self.species)

In the current implementation, when loading a checkpoint, it loads it as the n-th generation and overwrites the checkpoint - n even thought it is actually the n+1 generation that's named n. This could cause some loss of generations if we load the checkpoint many times and also some confusion as stated in the issue above. I added the fix that was discussed there

erupturatis avatar Aug 06 '22 18:08 erupturatis