reddragonnm / neatpy Goto Github PK
View Code? Open in Web Editor NEWA NEAT library in Python
Home Page: https://pypi.org/project/neatpy/
License: MIT License
A NEAT library in Python
Home Page: https://pypi.org/project/neatpy/
License: MIT License
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.