【发布时间】:2022-01-09 21:14:29
【问题描述】:
【问题讨论】:
标签: python neural-network artificial-intelligence neat
【问题讨论】:
标签: python neural-network artificial-intelligence neat
这会打印基因组的size 属性。引用自documentation:
返回基因组复杂性的度量。该对象目前仅在一代结束时提供给记者,以表明最高适应度基因组的复杂性。在 DefaultGenome 类中,此方法当前返回(节点数,启用的连接数)。
注意:您可以通过查阅reporting 的源代码找到这一点,其中显示最佳解决方案的size 属性就是正在打印的内容
def found_solution(self, config, generation, best):
print('\nBest individual in generation {0} meets fitness threshold - complexity: {1!r}'.format(
self.generation, best.size()))
【讨论】: