How to evaluate a NEAT neural network? I'm trying to write my own implementation of NEAT and I'm stuck on the network evaluate function, which calculates the output of the network.

NEAT as you may know contains a group of neural networks with continuously evolving topologies by the addition of new nodes and new connections. But with the addition of new connections between previously unconnected nodes, I see a problem that will occur when I go to evaluate, let me explain with an example:


INPUTS = 2 yellow nodes
HIDDEN = 3 blue nodes
OUTPUT = 1 red node


In the image a new connection has been added connecting node3 to node5, how can I calculate the output for node5 if I have not yet calculated the output for node3, which depends on the output from node5?

(not considering activation functions)

node5 output =  (1 * 0.5) + (1 * 0.2) + (node3 output * 0.8)
node3 output =  ((node5 output * 0.7) * 0.4)
Consider the execution order, 5 will have an invalid value because it hasn't been set form 3 yet. However the second time around it should have a value set. The invalid value should falloff after sufficient training.

0 -&gt; 5
1 -&gt; 5
5 -&gt; 2
2 -&gt; 3
3 -&gt; 4
3 -&gt; 5
RESTART
0 -&gt; 5
1 -&gt; 5