This work is based on the game SpaceShooter
I do these things on it:
- wrap the game for training
- test DQN algorithm on it
- Python3
- TensorFlow >= 1.1.0
- tflearn
- pygame
- OpenCV-Python
- my system is win10, linux/mac is a little defferent but easier
pip install tensorflow
pip install tflearn
pip install opencv-python
pygame click here: PyGame
tensorflow gpu click here: Windows10 64位下安装TensorFlow - 官方原生GPU版安装
- Test the model
python main.py
- Continue training
python main.py --train True
- Play the game by yourself
python main.py --human_play True
- Human Controls
Button | |
---|---|
Move Left | left |
Move right | right |
Fire bullets | spacebar |
Quit game | Esc |
This algorithm is on paper Human-level control through deep reinforcement learning
- The DQN code is nearly the same with FlappyBird_DQN_with_target_network
- When train,you can wipe off the background or not
- The algorithm is not very effective given the game is so easy.And its performance is very unstable.