Skip to content

A supervised machine learning algorithm built in Python to play the game Flappy Bird

Notifications You must be signed in to change notification settings

gustaver/reinforcement-learning-flappybird

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Machine Learning Flappy Bird

Overview

Flappy Bird game which has functionality for machine learning through Supervised Learning as well as Reinforcement Learning. The agent makes decisions using an Artificial Neural Network. The neural network should be initially trained by simply playing the game properly until a reasonable amount of data has been collected (≈2000 datapoints should work, use the p key to print data collection progress). Once a neural network has been trained, the agent can play autonomously by using the a key, and can further speed up data collection by pressing the r key.

How to run

Conda

It is highly recommended that you use conda for simply installing all of the Python requirements to a virtual environment. Conda installation instructions can be found here. Once you have installed conda, follow the instructions below.

Conda Environment

  1. From the root directory, create the conda environment using the bash command:
conda env create -f environment.yml -n <ENVIRONMENT NAME> 
  1. Activate the conda environment:
source activate <ENVIRONMENT NAME> 
  1. Start the game:
python flappy.py

How to play

The agent will gather data appropriately from the player, then the following commands can be used to execute different procedures:

p: Print the current state of the gathered training data to the terminal. 
t: Train the neural network on the collected data so far.
a: Switch autonomous mode on/off.  
r: Switch reinforcement learning speed-up on/off. 

About

A supervised machine learning algorithm built in Python to play the game Flappy Bird

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages