-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
fix: used initial observation the entire time #274
base: master
Are you sure you want to change the base?
Conversation
break | ||
except KeyboardInterrupt: | ||
print("User break.") | ||
break | ||
|
||
finally: | ||
# Save the winners. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could put an if best_genomes:
here to handle the case where the user terminates within the first 5 generations (if I read it correctly, best_genomes
will be undefined in that case).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. I defined best_genomes = None
in the top to make sure the variable exists and can be checked and added an if best_genomes
on the bottom
But I still feel like this example is broken. I can't get it to learn after almost 8000 gens. I had a simpler example with the Lunar Lander and this package a few years ago that worked quite well. Tho I can't find that code rn. Maybe I find some time to troubleshoot it at some point. @ntraft Can you get it to work? |
Oh, really?? As in, you were able to "solve" the Lunar Lander, or at least do well? I assumed that it never worked, when I started using this package ~9 months ago! Did you see my issue #256 about the Lander example? Did you address the issue with the fitness function? I wonder what kind of fitness you were using when you had it working before? I started using the Bipedal Walker instead, and it works kinda okay on flat terrain, but nowhere near as well as anything you see in these Evolution Strategies examples. But even to get to that point I had to fix the FeedForwardNetwork so that it will run nodes even if they don't have an input. I should probably also implement something to prevent the dangling nodes from appearing in the first place, like you did. I was trying to avoid that, at first, because I wasn't sure if it was intentional and wasn't sure about the best way to fix it. I put this project away for awhile but it's seeming like if I go much further with it I would have to address that issue. It would be great to see it solve Lunar Lander! I just assumed it was too hard. I'm also curious, do you remember how important the speciation parameters were for your success? Tuning the speciation is seeming like a hot mess to me. |
No I wasn't able to solve it with the current code example even after thousands of generations. I think the fitness function is wrong or at least buggy but I haven't had enough time to debug it yet. I also think the fitness function is overly complicated. I will check my old hard dist because I am pretty sure that my own code from like a year a ago solved it kinda quickly. |
Note some other issues that are suspicious and may be part of the problem: I think elitism isn't working correctly, and best genomes might not be returned correctly, and this might also be negatively impacting speciation. I'm going to try to investigate some of it this week. |
These ever get solved? |
@allinduetime check https://github.com/Finebouche/neat-gymnasium. We could think about merging the project here in the examples actually. But it look like @CodeReclaimers is not maintaining it ATM |
Fixes a bug where the initial observation is used over and over again.
Ensures the network is rendered even if the environment is not solved or aborted