NeuroEvolution – Flappy Bird
This is one of these fantastic &quot;all that is done with so little code?!&quot; moments.<p>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.<p>Edit:
Somebody has asked about the big picture how the thing works:<p>You use a neuronal network to decide at each step to flap the birds wings or not. That is the only output. The input is only the birds height (y-position) and the height of the next hole. (<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Feedforward_neural_network" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Feedforward_neural_network</a>)<p>The question now is how to find the correct weights for the net.<p>That net is not trained in a traditional supervised way like with gradient descent (which would be more complicated). Instead it uses a genetic algorithms to find new weights for neuronal networks of future generations. That is use some of the best individuals. Some randomly generated ones and some created by breeding from existing individuals. (<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Genetic_algorithm" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Genetic_algorithm</a>)<p>And that&#x27;s basically it in this case.