NEAT 中个体的复杂性-Python

Complexity of individual in NEAT-Python

当我用 NEAT-Python 编程并完成我的实验时,我从 NEAT 记者那里收到了关于一个人的消息。 complexity后面的数字是什么意思?

这会打印基因组的 size 属性。引用自 documentation:

Returns a measure of genome complexity. This object is currently only given to reporters at the end of a generation to indicate the complexity of the highest-fitness genome. In the DefaultGenome class, this method currently returns (number of nodes, number of enabled connections).

注意:您可以通过查阅 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()))