我已经使用 Pyevolve 进行了优化,在查看了结果后,我想添加几代以实现更好的收敛。由于评估时间很长,我想知道是否可以将优化恢复到上一代并增加 20 代以上。我希望一切都必须在数据库中设置,这样他才有可能。
这是我的 GA 属性(类似于第一个示例,但具有更复杂的评估函数):
# Genome instance, 1D List of 6 elements
genome = G1DList.G1DList(6)
# Sets the range max and min of the 1D List
genome.setParams(rangemin=1, rangemax=15)
# The evaluator function (evaluation function)
genome.evaluator.set(eval_func)
# Genetic Algorithm Instance
ga=GSimpleGA.GSimpleGA(genome)
# Set the Roulette Wheel selector method, the number of generations and
# the termination criteria
ga.selector.set(Selectors.GRouletteWheel)
ga.setGenerations(50)
ga.setPopulationSize(10)
ga.terminationCriteria.set(GSimpleGA.ConvergenceCriteria)
# Sets the DB Adapter, the resetDB flag will make the Adapter recreate
# the database and erase all data every run, you should use this flag
# just in the first time, after the pyevolve.db was created, you can
# omit it.
sqlite_adapter = DBAdapters.DBSQLite(identify="F-Beam-Optimization", resetDB=True)
ga.setDBAdapter(sqlite_adapter)
# Do the evolution, with stats dump
# frequency of 5 generations
ga.evolve(freq_stats=2)
有这个想法的人吗?