GMUEClab / ecj

ECJ Evolutionary Computation Toolkit
http://cs.gmu.edu/~eclab/projects/ecj/
123 stars 42 forks source link

NEAT crossover #45

Closed SigmaX closed 6 years ago

SigmaX commented 6 years ago

Jorge Gomes jorgemcgomes@gmail.com writes:

I think something is wrong with the NEAT crossover.

When crossover is used, the network suddenly start losing links. It sometimes evolves networks with less links than the networks of the initial population (which are fully connected, no hidden neurons). I don’t see how this could happen -- how can the crossover result in a network that is smaller than both its parents?

I don’t think this is normal behaviour. It definitely doesn’t occur in the other NEAT implementations I’ve tried. When the crossover is disabled, this doesn’t happen anymore, the networks grow over time as expected. I couldn’t pinpoint the reason for this strange behaviour.

SigmaX commented 6 years ago

Jorge provided a Statistics class (Gist here) that collects data from NEAT. He says the reported behavior occurs in the following case:

java -cp "." ec.Evolve -file ec/app/xor/xor.params -p stat.num-children=1 -p stat.child.0=ec.neat.NEATStatistics -p stat.child.0.file=neat.stat -p seed.0=199573726

Anson took a look at the code and emailed me as follows:

If I'm understanding Jorge's code correctly, it looks as though he's gathering information about number of links by checking the generated NEATNetworks, rather than the NEATIndividuals. Because the NEATNetwork doesn't include disabled genes, the behavior Jorge's describing isn't out of the ordinary. That's assuming I've understood everything.