2
我已經使用Pyevolve進行了優化,並且在查看結果後,我想添加幾代以獲得更好的收斂性。由於評估時間很長,我想知道是否可以繼續優化到最後一代,並增加20代。一切都必須在DB中設定,我希望他可以做到。使用pyevolve恢復優化
這裏是我的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)
任何人的想法?
謝謝你的回答。我將對DEAP的進化能力有一個清晰的認識。評估功能相當長時,恢復一些優化是非常有幫助的。 – TazgerO
任何想法如何隨着你一起去泡菜?這將是非常有幫助 – Anake
泡菜和DEAP?如果您有關於DEAP的特定問題,請使用用戶組。 – mitch