Earlier quoted context omitted.
What's interesting is I've run it several times now, and I've gotten the perfect bird about half the time on an early generation (<10), but sometimes it just doesn't want to find it for a while. I'm wondering if the net is just at the threshold of being the minimal set of neurons that are needed for it to be able to get it so easily by random chance.
I was surprised to get a winner on generation 7 the first time I started the trainer. Subsequent trials were much worse.
NeuroEvolution – Flappy Bird
51–60 of 103 posts
Re: NeuroEvolution – Flappy Bird
#52Not worked on FF, maybe it has to do with my plugins/privacy settings.
Re: NeuroEvolution – Flappy Bird
#53This is one of these fantastic "all that is done with so little code?!" moments. Amazing that this can be done in 300 lines of perfectly readable JS without any libraries. And the author apparently wrote it in 2 days. Great intro to genetic algorithms and reinforcement learning. Universities should teach like that. Edit: Somebody has asked about the big picture how the thing works: You use a neuronal network to decid…
This is going to turn out to be a rant, but sometimes it feels like there's a culture of solving problems by a philosophy of "let's throw more money at it, more technology at it, more people, more unnecessary abstraction layers, complexity and bloat - it's bound to be solved eventually". And with enough fire power, it usually is - but at what cost... I'm not sure what the source of the problem is though, and it's not only with code. Many times I struggle to understand certain concepts via professional literature, and when I finally understand them, I'm puzzled as to why they are taught in a way that if I didn't know better, I'd assume a deliberate attempt to confuse the reader instead of making the learning simple, intuitive and fun.
Exactly the same applies to code I've had to refactor and sometimes rewrite over the years. Obviously, some of it has to do with trying to get a product out in crazy schedules which requires making compromises, but I can tell the difference between compromise and "I don't really care" attitude, and I'm talking about the latter. It's a pity though - not only for the one that has to sort out and sometimes clean up the mess, but also for the one that creates it. Things are so much more fun where you care and are passionate about what you do, that I'm sorry for those who are missing out on it.
End of rant. Not sure it belongs here but had to get it out of my system :-)
Re: NeuroEvolution – Flappy Bird
#54Re: NeuroEvolution – Flappy Bird
#55Re: NeuroEvolution – Flappy Bird
#56Re: NeuroEvolution – Flappy Bird
#57I accidentally left this open in another tab for several hours and it got to over 550k score on generation 35. That was fun to see!
EDIT: actually generation 33 is still happening, even on "5x" mode, 260k points and counting. Looks like it totally got how the game works.
Re: NeuroEvolution – Flappy Bird
#58Earlier quoted context omitted.
I was surprised to get a winner on generation 7 the first time I started the trainer. Subsequent trials were much worse.
I was surprised that I got one that get really far and then in the next generation they failed right at the start
Re: NeuroEvolution – Flappy Bird
#59Interestingly, the updates are done on the basis of only 2 external inputs [1]: the height of the bird in the screen and height of the aperture in the next pipe. Using only these two parameters the neural network decides whether to flap or not. I would had expected at least also the horizontal distance from the next pipe... [1] https://github.com/xviniette/FlappyLearning/blob/gh-pages/ga...
edit: With sigmoid or hard-threshold activation, this function is really simple to implement. If we want to flap iff bird is lower than pipe, we can do that with no hidden layers and a weight vector of [1 -1]. I'd be curious to see someone fork and implement this.
Re: NeuroEvolution – Flappy Bird
#60Earlier quoted context omitted.
I was surprised that I got one that get really far and then in the next generation they failed right at the start
In a GA approach, you'd have kept that bird AND mutate/breed offspring from it. In a NN, you often get oscillation during training.