neat-python icon indicating copy to clipboard operation
neat-python copied to clipboard

Hidden nodes raise genetic distance

Open regtm opened this issue 3 years ago • 1 comments

When initiating networks with hidden nodes, compatibility_weight_coefficient set to zero and all structural mutation rates set to zero the first generation still has a genetic distance that is greater than zero. Am I missing something here? I'd expect all initialized genomes to be identical when no structural mutations are present.

regtm avatar Apr 22 '21 11:04 regtm

I'm facing a similar issue. I guess there are two things which may cause this

  1. Due to "connection_fraction", a fraction of the full connections were created randomly, which can cause graph structure difference. See the function here. This is expected I think.
  2. The current implementation creates nodes with new IDs for hidden layers during each genome initialization, instead of re-using the IDs. Refer to this code. This would cause disjoint_nodes which increases the genome distance. I'm still new to NEAT so don't know if this is the correct behavior, as the original NEAT paper suggests to start with NO hidden layer anyway... I hope someone with more experience could comment on this. Thanks!

zedwei avatar Jul 22 '21 23:07 zedwei