TLmaK0 / rustneat

Rust Neat - NeuroEvolution of Augmenting Topologies
MIT License
68 stars 16 forks source link

Starting with a single neuron, no useful evolution can happen for many generations #34

Open Ploppz opened 5 years ago

Ploppz commented 5 years ago

Both in the XOR example and in my own attempts, I noticed something: The first 100-200 generations, the output of organism.activate is 0.0. So we are essentially waiting for any connection between input and output, while no evolution other than random mutation can happen because fitness will be constant for the organisms that only output 0.0.

So I suggest either starting from a slightly more connected starting point, or finding a way to make the alg more 'eager' to add connections early on (but maybe this is not in line with the original alg), or let the user specify a starting point (that is, a genome or NN architecture to start with). Maybe it would already be a good improvement to connect the one start neuron with all inputs and outputs.

TLmaK0 commented 5 years ago

thanks @Ploppz, I noticed this behavior, and I'm agree with your solution. We should be able to send a predefined net to the algorithm. For me, NEAT it's only the base for the project, If we find better ways to do things we should add to the project.

Ploppz commented 5 years ago

Edit: I am talking about ways to boost the algorithm in general. We could also make it possible to start with a predefined genome of course. Edit 2: I rewrote this after reading the paper.

The paper splits neurons into input, hidden and output neurons. I think we should in any case start with n_inputs + n_outputs number of neurons. Then some questions are:

TLmaK0 commented 5 years ago

I'm exactly in the same point. When I started the project I was thinking that the algorithm should be as much standard as possible, I mean that the user should not configure the net, only call the algorithm with inputs and outputs and get results. I think that connect inputs with outputs by default will improve the performance, as you say this, implementation take a lot of generations to make any improvement.

I think Ctrnn discriminates inputs and hidden neurons. This section it's the most obscure for me, I did some tests changing it, and I'm not sure it's well implemented. In the readme of the function_aproximation branch there is a link to Ctrnn paper.