Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NEAT algorithm: How to crossover disjoint and excess genes?

I am currently implementing the NEAT algorithm developed by Kenneth Stanley, taking the original paper as a reference.

In the section where the crossover method is described, one thing confuses me a little bit.

enter image description here

So, the above figure is illustrating the crossover method for NEAT. To decide from which parent a gene inherited, the paper says the following:

Matching genes are inherited randomly, whereas disjoint genes (those that do not match in the middle) and excess genes (those that do not match in the end) are inherited from the more fit parent.

For the matching genes (1 - 5) it's easy to understand. You just randomly inherit from either Parent1 or Parent2 (with 50% chance for both). But for the disjoint (6-8) and excess (9-10) genes you cannot inherit from the more fit parent because you only have those genes in either Parent1 or Parent2.

For example:

Parent1's fitness is higher than Parent2's. The disjoint gene 6 only exists in Parent2 (of course, because disjoint and excess genes only occur in one parent) So, you cannot decide to inherit this gene from the more fit parent. Same goes for all other disjoint and excess genes. You can only inherit those from the parent they exist in.

So my question is: Do you maybe inherit all matching genes from the more fit parent and just take over the disjoint and excess genes? Or do i missunderstand something here?

Thanks in advance.

like image 329
Tom B. Avatar asked May 27 '18 15:05

Tom B.


People also ask

How does the NEAT algorithm work?

NEAT sets up their algorithm to evolve minimal networks by starting all networks with no hidden nodes. Each individual in the initial population is simply input nodes, output nodes, and a series of connection genes between them.

What is NEAT illustrator?

NeuroEvolution of Augmenting Topologies (NEAT) is a genetic algorithm (GA) for the generation of evolving artificial neural networks (a neuroevolution technique) developed by Kenneth Stanley and Risto Miikkulainen in 2002 while at The University of Texas at Austin.

What is NEAT in python?

NEAT is a method developed by Kenneth O. Stanley for evolving arbitrary neural networks. NEAT-Python is a pure Python implementation of NEAT, with no dependencies other than the Python standard library. Currently this library supports Python versions 3.6 through 3.11, as well as PyPy 3.


1 Answers

It might help to look at the actual implementation and see how it is handled. In the original C++ code here (look at lines 2085 onwards), the disjoint and excess genes from the unfit parent seem to be just skipped.

In your implementation, you could inherit disjoint and excess genes from the unfit parent but disable them with probability 1 so you can do pointwise mutations on them (toggle disabled to enabled) later on. However, this might result in significant genome bloat, so test and see what works.

like image 144
cantordust Avatar answered Sep 28 '22 06:09

cantordust