joeddav / devol

Genetic neural architecture search with Keras

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Return or save best model after each generation.

wroscoe opened this issue · comments

This is a great. For this to be immediately useful the devol.run() function should return or save the model that had the lowest validation error. This model can then be trained to completion or reinitialized and retrained.

I figured out how to recreate the model but it still requires some tinkering to get it to model.predict(x_test) since the soft max layer is not included.

f = open('Sun May 28 09:53:45 2017.csv')
genomes = f.read().split('\n')
line = genomes[-2] #get last saved model
last = line.split(',')
last = [int(i) for i in last[:-2]] #only get the model parameters.
model = genome_handler.decode(last)
model.summary()

Yeah I just went through the same thing when using this on another project. I agree that'd be a great addition, as doing the above ^ is an unnecessary amount of overhead. It should be pretty straightforward to implement as well.

Added return of best model, as well as functionality to easily get and/or decode the best model from the csv.