You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

NEAT算法交叉操作疑问:disjoint与excess基因的继承规则

关于NEAT算法交叉规则的澄清:disjoint/excess基因的继承逻辑

Great question—this is a common point of confusion when first diving into NEAT's crossover rules, and I remember scratching my head over it too!

Let's start by restating the core crossover rules from Stanley's original paper to make sure we're on the same page:

When crossing over, genes are randomly inherited from either parent if they match. Disjoint and excess genes are inherited from the more fit parent. If the parents are of equal fitness, disjoint and excess genes are inherited randomly from either parent.

Your confusion comes from a subtle but important misinterpretation of the rule. Here's the key clarification:

  • When the rule says "disjoint and excess genes are inherited from the more fit parent", it only applies to the disjoint/excess genes that exist in the more fit parent.
  • Any disjoint/excess genes that are unique to the less fit parent are discarded entirely—they are not passed to the offspring, because the more fit parent doesn't have them to "inherit" from.

Using your example: if Parent 1 has higher fitness than Parent 2, and disjoint gene 6 only exists in Parent 2, the offspring will not inherit gene 6. The rule's "inherit from the more fit parent" here effectively means we ignore any unique genes from the less fit parent.

To break down the full crossover logic step-by-step (which helps avoid this confusion):

  1. Sort all genes from both parents by their innovation number (this is how NEAT tracks homologous genes).
  2. For matching genes (same innovation number): Randomly pick the gene (including its weight, enabled status, etc.) from either parent.
  3. For disjoint/excess genes:
    • If one parent is significantly more fit: Only keep the disjoint/excess genes that belong to the more fit parent.
    • If parents have roughly equal fitness: Randomly choose whether to keep each disjoint/excess gene from either parent.
  4. Assemble the offspring's genome from the selected genes, maintaining the innovation number order.

If you want to confirm this, look at any standard NEAT implementation (like Stanley's original Java code or popular Python ports). You'll see that when iterating through the parents' genes, they skip over any unique genes from the less fit parent entirely.

内容的提问来源于stack exchange,提问作者Tom B.

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 07:10:16