Maybe a suggestion: you might find it useful to drop some checkpoints (
http://deap.gel.ulaval.ca/doc/dev/tutorials/advanced/checkpoint.html) every few generation and inspect the population/pareto front from there by reloading populations
I have some sample code I use to store and load checkpoints. It's a bit hacky, and not super efficient as I'm just pickling everything I need and reloading it when I rerun my program, but I'm able to resume an existing point and reproduce the same results consistently. The code below should give you an idea. Feel comment or question the code :)
def store_checkpoint(path,
population,
generation,
halloffame,
logbook,
toolbox,
rndstate,
numpystate,
pset=None
):
"""
# Stores the curent population and stats along with the 'random' state
"""
cp = dict(population=population,
toolbox=toolbox,
generation=int(generation),
halloffame=halloffame,
logbook=logbook,
rndstate=rndstate,
numpystate=numpystate
)
print "Writing gen", generation, "at path", path
with open(path, 'w') as f:
json.dump(cp, f)
pickle.dump(cp, f)
def explode_checkpoint(path, pset):
try:
deap.creator.Individual
except:
deap.creator.create("Individual", deap.gp.PrimitiveTree, fitness=deap.creator.FitnessMax, pset=pset)
with open(path, "r") as f:
cp = json.load(f)
return cp['population'], cp['toolbox'], cp['generation'], cp['halloffame'], cp['logbook'], cp['rndstate'], cp['numpystate']
.