I would had expected at least also the horizontal distance from the next pipe...
[1] https://github.com/xviniette/FlappyLearning/blob/gh-pages/ga...
I would had expected at least also the horizontal distance from the next pipe...
[1] https://github.com/xviniette/FlappyLearning/blob/gh-pages/ga...
This isn't my field, but given the simplicity of the inputs and network, and the way commenters are seeing the demo achieve perfect play after anything between 2 and 200 generations, it makes me wonder if this isn't more of a brute-force search than actual learning?
That is, it smells like there's a "correct" set of neuron values - where any genome within some tolerance of those values wins forever, and any other genome dies quickly. If that's the case, the system can't really evolve towards a solution, can it? It would just cycle randomly through lots of genomes that die immediately, until by pure chance one lives forever. I only tried the demo a few times but that's what it looked like it was doing.
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.
Yes, slightly disappointingly the neural network can be replaced by the line:
if((this.birds[i].y - 70) / this.height > nextHoll) this.birds[i].flap();
What does make the distance irrelevant is that the holes are high enough to safely flap whilst inside them, so you never have to make a timed leap through, a luxury not afforded to users of the original game if I recall.
If the aperture is smaller than the jump height, then you need to do something smart to time your jumps.