You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A connection is considered valid if it is from a node to a node with a higher y.
See line 280 in brain.py in _valid_conn:
node1.y <= node2.y
However in evaluation, the nodes are evaluated in the natural list order which by inspection appear to be in .id order, not .y order.
See line 302 in brain.py in predict
for node in self.nodes:
This needs to read something like
for node in sorted(net.nodes,key=lambda node : node .y):
Without this change, randomly it evaluates nodes which have a value still set to zero because the connection goes forward through the list.
I ran into this because in my code I have a forked version of predict which runs the data through the network as a numpy array for accelerated processing and the uninitialized zero value didn't play well with slicing for the relu zeroing. As is, in your version, the library will look like it is working, but there will be nets which fail the evolution not because of a bad connection, but because the signal reads as zero when it shouldn't. You should be able to prove that this is happening by setting the default value to None on line 297 and then asserting it is not None when iterating input connections on line 314.
The text was updated successfully, but these errors were encountered:
A connection is considered valid if it is from a node to a node with a higher y.
See line 280 in brain.py in _valid_conn:
node1.y <= node2.y
However in evaluation, the nodes are evaluated in the natural list order which by inspection appear to be in .id order, not .y order.
See line 302 in brain.py in predict
for node in self.nodes:
This needs to read something like
for node in sorted(net.nodes,key=lambda node : node .y):
Without this change, randomly it evaluates nodes which have a value still set to zero because the connection goes forward through the list.
I ran into this because in my code I have a forked version of predict which runs the data through the network as a numpy array for accelerated processing and the uninitialized zero value didn't play well with slicing for the relu zeroing. As is, in your version, the library will look like it is working, but there will be nets which fail the evolution not because of a bad connection, but because the signal reads as zero when it shouldn't. You should be able to prove that this is happening by setting the default value to None on line 297 and then asserting it is not None when iterating input connections on line 314.
The text was updated successfully, but these errors were encountered: