New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Many dangling nodes without a connection to an output are created / left -> network breaks the longer you run it #250
Comments
I have the exact same problem! |
Same problem ! |
This seems like a feature, I didn't make this library but read about the mechanisms used for evolution. Sometimes neurons get isolated or replaced at random, this includes disabling a connection that was there before, and which could also get reconnected at random |
I tried the following in the config to deactivate the disabling of connections: I still get a lot of dangling nodes and a mostly "broken" net. |
I created a fork that has a changed implementation. It will remove all dangling nodes and connection at the end of every run If people wanna try it out: |
Even without "disabled" (but existing) edges, you could still get lots of dangling nodes due to deleting edges, right? And you probably wouldn't want to disable the deleting of edges entirely, so that brings us back to where we started. I don't know whether other NEAT implementations prevent this. It seems a bit ambiguous as to whether this is desirable or not; maybe those nodes could be rewired to be useful in a future generation. On the other hand, you're right that it adds more and more bloat as the algorithm progresses! Even if we're able to prune these away when instantiating the network, we are still wasting lots of time mutating them when they'll have no impact on the final output. Btw, have you tried |
Describe the bug
Currently I am running NEAT for a long time and inspect the growth of the network from time to time. I started to notice that NEAT creates many "dead ends" / "dangling nodes" -> Nodes that are not going anywhere and are not connected to another node or an output. Yesterday I found an example with quite a few in them.
I am unsure if that happened with older versions before (or to this extend).
Maybe that behavior is desired?
I would have expected, that "dangling" nodes are either removed too when the connected node(to the exit/next leading node) is removed or that the node is re-connected to the node that comes after the removed one.
There are also nodes that are "going out" of an output that are not recurrent?! I don't think that should happen either?
The longer you run the algorithm the more "crude" and broken the network gets, up to a point when you have almost no "functional" nodes anymore because they are not connected to an output anymore
To Reproduce
I used:
- gym 0.25.1 with 'Alien-v4'
- neat 0.93
- config see below
OS:
Expected behavior
No "dangling" nodes and no nodes that "leave" an exit (maybe except of recurrent ones)
or
When nodes get removed and would leave a dangling node behind then they should either be removed too or be connected to the nodes that come after the now removed node
Screenshots with problematic nodes
Used Config
The text was updated successfully, but these errors were encountered: