1
$\begingroup$

I have just started learn to use NEAT algorithm. I was thinking I understood the basics of NEAT when I read "Evolving Neural Networks through Augmenting Topologies" paper and current python documentation. However, in practice I m in trouble.

I have run XOR examples from source (https://github.com/CodeReclaimers/neat-python.git). However, when I run any of "evolve-feedforward.py", "evolve-feedforward-parallel.py" or "evolve-minimal" codes more than once, results are changing. For instance,

When I run "evolve-feeedforward.py" it gives : 1

when I run same code for second time, it gives: 2

and it changes with each run. I have also deleted generated neat-checkpoint files before each run, but structure still changes. I would like to understand reason what cause this, I think I m missing some essential points here.

$\endgroup$

1 Answer 1

1
$\begingroup$

Provided each network implements the XOR function approximately, but within reasonable error bounds, then this is NEAT behaving as designed.

Neural networks allow for multiple equivalent solutions. Even using a fixed architecture and stochastic gradient descent to learn a simple function, there is a good chance of ending up with very different weights each time. With NEAT, it also explores alternative architectures, and the search includes many calls to random number generators in order to make decisions.

The main deterministic step in NEAT is the selection process - comparing population members with each other to rank them in terms of fitness. However, as multiple designs of neural network can all solve the XOR problem roughly equally well, it is unlikely this will find the same one each time.

If you need to exactly reproduce an experiment in NEAT, you can achieve that by setting the RNG seed. I think this could just be a call to random.seed() for the library you are using, but some libraries may have other RNG instances that need setting up too.

$\endgroup$
1
  • $\begingroup$ Dear Neil Slater, thanks a lot for your kind explanation. I got it now. $\endgroup$ Commented Nov 10, 2018 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.