【问题标题】:Python DEAP - Getting the Pareto Front for every generationPython DEAP - 让每一代人都处于帕累托前沿
【发布时间】:2019-11-24 23:16:46
【问题描述】:

我正在使用 DEAP 使用 eaSimple 运行多目标优化。代码在最后一代之后返回ParetoFront()。 有没有办法为每一代获得一组ParetoFront()?我希望看到每一代战线的演变。

【问题讨论】:

    标签: deap


    【解决方案1】:

    一次只运行一代。每次,对上一次运行输出的总体运行算法。

    类似

    ngen = 50
    pop = toolbox.population(n=100)
    
    for i in range(ngen):
        pop, logbook = algorithms.eaSimple(pop, toolbox, cxpb=0.5, mutpb=0.2, ngen=1)
    

    您只需将您对 Pareto 前端所做的任何事情添加到上面的代码中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-24
      • 1970-01-01
      • 1970-01-01
      • 2018-08-18
      • 1970-01-01
      相关资源
      最近更新 更多