6232RE: Starting with Neat, the XOR problem, some questions
- Jan 6, 2014
Hi Ken thanks for the response. You are correct I am still trying to get familiar with NEAT. I have gone through as many of the source code examples as possible trying to strip then done to the bare bones but my c++ is not very good! I have my basic XOR working now within about 30 to 100 generations, but I am not very happy with how it is working. My basic issue now is the reproduction concept with multiple species.
If I start with a very basic XOR example, if I start the population all with the same structure with all inputs connected to the output and no hidden nodes, all population members will be the same species with just different weights. Before I can add any new connections I first have to add a new node.
So, for one population member I add a new node, because it has a different number of nodes and different connection genes I will call this a new species (for this example). When it comes to mating, this new species can only mate with the original species because it contains all the same nodes as the initial species, but the initial species cannot mate with new species. This may sound wrong but the child has to have all the same nodes as the new species because if the child takes the nodes of the initial population, when you try to mate the new species, you may end up with connection genes for nodes that do not exist in the child. This is where I could be going wrong because at the moment during mating/crossover I am simply crossing over the connection genes, perhaps I should be also crossing over the connection nodes as well? I will change the code to try this.
For the reproduction, does the population always stay the same size, or will it grow and shrink dynamically? In my work at the moment the population size is fixed. This means that I may create a new species, that species may have a terrible fitness so it is poorly represented in the mating pool so may die out quickly. In my implementation I always take one copy of the best member of each species directly in the new population until that species reaches a certain age in an attempt to try to get the species to grow into something useful. The problem this creates is that I end up with a lot of species that have difficulty mating because they have initial poor fitness.
For your fitness sharing step, I understand that you define the species based on the distance function (ie all member with the fitness function < x are the same species), once you have the normalized fitness for each member of that species do they then get added to the mating pool as a function of species fitness rather then population fitness. I will assume this is correct and try this in the code.
Thanks for the support. I think the neat concept is genius, it's the actual implementation details that are holding me back and of course a forum is not the easiest way to discuss complicated concepts but I am sure I will get there soon.
- << Previous post in topic Next post in topic >>