Skip to content

Various reinforcement learning algorithms applied to Flappy Bird game agent

Notifications You must be signed in to change notification settings

reinai/FlappyBirdAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlappyBirdAI

About project

Implementation of Flappy Bird reinforcement learning agent by using two approaches:

  • Q learning (2000 episodes - trained about 2 minutes, 150 000 episodes - trained 7 hours)
  • Monte Carlo Q learning (2000 episodes - trained about 9 minutes, 50 000 episodes - don't know the exact time, 150 000 episodes - trained 11.5 hours)

In folder basic-q-learning we trained our model with basicq_2000.txt and basicq_150000.txt, so just run runBasicQLearning.py and open one of these files, and in folder monte-carlo-q-learning with monte_2000.txt and results_150000.txt and run runMonteCarloQLearning.py.

Programs & libraries needed in order to run this project

  • PLE: A Reinforcement Learning Environment mimicking the Arcade Learning Environment interface, allowing a quick start to Reinforcement Learning in Python
  • NumPy fundamental package for scientific computing with Python
  • Pillow Python Imaging Library
  • pyGame cross-platform set of Python modules designed for writing video games
  • other helper modules which can be installed manually

Game run example

Preview

Results after 2000 episodes

alt text Basic Q learning has still problems after 2000 episodes, sometimes getting score about 4. Training lasted about 2 minutes. alt text Monte Carlo Q learning after 2000 episodes in which training lasted about 9 minutes has tremendously better results, averaging at about score of 80.

Q learning and Monte Carlo Q learning

alt text