Live data from Hacker News

Hacking Flappy Bird with Machine Learning

sarvagyavaish.github.io

11–20 of 56 posts

Re: Hacking Flappy Bird with Machine Learning

#11
post #7

I was waiting for something like this, but I expected somebody to build a flappy bird playing robot :) Do you know some good literature for machine learning 101? Where to start?

So was I. I remember a posting about deep learning on HN, they managed to let the algorithm play a NES game purely by analyzing the video. So who is up for the challenge?

Re: Hacking Flappy Bird with Machine Learning

#14
I really want to build a Lego Mindstorms robot (or similar) that watches my phone with a webcam, holds a stylus, and plays Flappy Bird. I have played enough (high score 194) that I am pretty sure I know the right strategy, I just want to take human error out of the equation.

Are there open source vision libraries that are low-latency enough to play this in real time? Assuming the robot could keep up with some regular servos. Would be a very interesting project.

Edit: I'm thinking I could run an Android emulator, and then use MonkeyRunner with Python OpenCV processing my monitor to do the work. Anyone who has any relevant experience please reply, I'd love to hear if this is feasible.

Re: Hacking Flappy Bird with Machine Learning

#15
post #7

I was waiting for something like this, but I expected somebody to build a flappy bird playing robot :) Do you know some good literature for machine learning 101? Where to start?

So was I. I remember a posting about deep learning on HN, they managed to let the algorithm play a NES game purely by analyzing the video. So who is up for the challenge?

I would try but how can you get input and output from the flappy bird game?

Re: Hacking Flappy Bird with Machine Learning

#16

Very cool! It's remarkable that you can get a good score with effectively only two features: vertical distance from the lower pipe and horizontal distance from the next pair of pipes. I suspect you could cut the training time by an order of magnitude with a different optimization algorithm, or just by varying alpha. For example, have you considered trying something like a line search? http://en.wikipedia.org/wiki/Lin…

reenforcement learning is not an optimization algorithm, and his times are consistent with an off the shelf Q-learning approach.

reenforcement learning is trying to find the optimal policy of action from a given position in the discrete state space.

The policy is roughly a map between state -> action. But it understands the temporal nature of the world.

It will start knowing nothing, then discover hitting a pipe is really bad, therefore states close to nearly hitting a pipe are almost as bad. Over tons of iterations the expected negative value of hitting a pipe bleeds across the expected value of the state space.

With regression and optimization, its never clear what you are optimizing against. Obviously hitting a pipe is bad. But what about the states near a pipe? Are they good or bad? There is no natural metric in the problem that tells you the distance from the pipe or what the correction action should be.

So that's the major different between reenforcment and supervised learning.

Re: Hacking Flappy Bird with Machine Learning

#18
post #14

I really want to build a Lego Mindstorms robot (or similar) that watches my phone with a webcam, holds a stylus, and plays Flappy Bird. I have played enough (high score 194) that I am pretty sure I know the right strategy, I just want to take human error out of the equation. Are there open source vision libraries that are low-latency enough to play this in real time? Assuming the robot could keep up with some regular…

Someone made a robot that played Angry Birds: https://us.pycon.org/2012/schedule/presentation/470/

I was wondering if this would work for Flappy birds. Due to the speed of the game, I think it is going to be quite a challenge.

P.S. If you are interested in the mindstorms robot part, I'll put a shameless plug for a robot I built some time ago (based on some work by David Singleton). Code is on github but here is a pycon video: http://pyvideo.org/video/1195/self-driving-lego-mindstorms-r...

Re: Hacking Flappy Bird with Machine Learning

#19
Neat AI approach to play it. When this first blew up 5 or so days ago I threw together a simple javascript bookmarklet that played the game at: http://www.mrspeaker.net/dev/game/flappy/

It's really poorly formatted and has unused code in it but it was fun to automate and watch. http://pastebin.com/yTmdWgfC

To use it just install the bookmarklet, click on it and then start the game. Press space to make it die.

Post reply on HN