整洁的 [英] NEAT: Speciating
问题描述
我尝试使用原始论文来实现自己的整洁,但是被卡住了.
I was trying to implement neat myself, using the original paper but got stuck.
比方说,我在上一代中有以下物种:
Let's say that in the last generation I had the following species:
Specie 1: members: 100 avg_score: 100
Specie 2: members: 150 avg_score: 120
Specie 3: members: 300 avg_score: 50
Specie 4: members: 10 avg_score: 110
我现在对下一代的尝试.如下:
My attempt right now for the next gen. is the following:
- 从每个物种中除去一个随机基因组之外的每个基因组.
- 将每个基因组放入物种中/也许创建一个新的基因组
-
将物种得分设置为该物种中每个基因组得分的平均值.
- from each species, remove each genome except one random genome.
- place each genome in the species / perhaps create a new one
set the score of the specie to the average of the scores of each genome in the specie.
4.1通过杀死每个物种中最坏的90%进行繁殖.
4.1 reproduce by killing the worst 90% in each specie.
4.2根据得分来选择物种.
4.2 choose a specie, based on their score.
4.3从该物种中选择2个基因组并繁殖一个新的基因组.
4.3 from that specie, choose 2 genomes and breed a new genome.
我不确定这是否是正确的尝试,尤其是当我杀死"了90%的基因组时. 这个百分比值是我现在随机选择的(与概念有关).
I am not sure if this is the correct attempt, especially when I "kill" 90% of the genomes. This percentage value is choosen randomly by me right now (it's just about the concept).
如果一个物种在被杀之后拥有0个成员.然后它灭绝了吗?
If a specie, after the killing, has 0 members. Did it then go extinct?
在给定的示例中,如果杀死90%,物种4可能会灭绝.
In my given example, Specie 4 is likely to go extinct if I kill 90%.
我的尝试正确吗,或者一个物种通常如何灭绝?
Is my attempt correct, or how does a specie usually go extinct?
推荐答案
首先,我强烈建议不要尝试从头开始实现NEAT.这比起初看起来要复杂得多(可以随意查看许多可用实现的公共存储库).
Firstly, I would STRONGLY suggest NOT trying to implement NEAT from scratch. It is a much more complex thing to do than it may seem at first (feel free to take a look at the public repositories of the many available implementations).
现在,要更具体地回答您的问题:
Now, to answer your questions more specifically:
有很多NEAT口味.在您的情况下,您的疑虑似乎与精英主义的概念有关,是的,通常这是您需要设置的参数.通常,算法的工作原理如下:
There are many flavours of NEAT. In your case, your doubts seem to deal with the concept of elitism which, yes, is usually a parameter you need to set yourself. Typically the algorithm works like this:
- 特定基因组.也就是说,将它们排列到给定数量的物种中,使它们彼此靠近(例如,k均值物种形成).
- 选择精英.您从每个物种中保留给定数量或百分比的个体,并将其传递给新一代.根据您的应用方式,每个物种中至少会有一个成员生存下来.
- 根据适应度(也许还基于物种的适应度)选择要繁殖的基因组.这也允许实现不同的特定实现方式.
- 复制.有无性繁殖(所选基因组的变异)和有性繁殖.有性生殖的工作原理是从两个父母那里获得基因(再次是不同的实现方式),然后进行一些突变.存在种间和种内的有性繁殖(是同一个物种的父母还是另一个物种的另一个父母),但是您可以随意禁用其中任何一个.
- 重新评估后代(设置新的适应度值).
- 种类.
请注意,物种形成是周期性地重新应用的(通常是每一代),因此物种并没有真正的明确定义(没有任何东西可以真正阻止将未改变地复制到下一代的优良基因组分配给新物种) ).
Note that speciation is re-applied periodically (typically every generation), so that species don't really have a strong definition (nothing really prevents an elite genome, copied unaltered to the next generation, to be assigned to a new species).
如果您使用固定的种群大小和k-均值物种,则无论什么情况,总会有k种.从某种意义上讲,它们都是每次迭代的新物种.
If you are working with a fixed population size and k-means speciation, there will always be k species, no matter what. In a sense, they are all new species every iteration.
这篇关于整洁的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!