I'm currently implementing the NEAT algorithm. But problems occur when testing it with problems which don't have a linear solution(for example xor). My xor only produces 3 correct outputs once at a time:

1, 0 -> 0.99
0, 0 -> 0
1, 1 -> 0
0, 1 -> 0

My genome class works fine, so I guess that the problem occurs on breeding or that my config is wrong.


const size_t population_size = 150;
const size_t inputs = 3 (2 inputs + bias);
const size_t outputs = 1;
double compatibility_threshold = 3;
double steps = 0.01;
double perturb_weight = 0.9;
double mutate_connection = 0.05;
double mutate_node = 0.03;
double mutate_weights = 0.8;
double mutate_disable = 0.1;
double mutate_enable = 0.2;
double c_excess = 1;
double c_disjoint = 1;
double c_weight = 0.4;
double crossover_chance = 0.75;

Does anyone has an idea what the problem might be? I proof read my code multiple times, but wasnt able the figure it out.

Here is the github link to my code(not documented): click


1 Answer 1


Very old thread, but i will try to answer anyway. The configuration seems fine.

Try to implement a simple NE (without augmenting topologies) and check if it works.

If it works:
    the problem is with augmenting topologies
    here is a large topic, there are different 
    implementations for it. One problem that i found 
    and might be the problem is the offspring 
    breeding. The paper says to kill the worst 
    individuals from the population, not the works 
    from each species. This is not good at all, since 
    an offspring that mutates and he's bad will be 
    killed instantly. Also, i recommend to keep at 
    least the champion of each species alive.
    the problem is with the network
    i recommend you to try different activation 
    functions, not only the one from the paper 
    1/(1+e^(-4.9f*x)). My solutions seem to have only 
    1 hidden neuron with activation functions like 
    squared, absolute, gaussian (check difference- 
    based mutation operation for NEAT paper). Never 
    found the sigmoid.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .