Deep Q-learning using Keras to play Moody Man
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets/sprites Initial commit Oct 11, 2017
game Initial commit Oct 11, 2017
models Initial commit Oct 11, 2017
.gitignore Initial commit Oct 11, 2017
README.md Update README.md Dec 4, 2017
__init__.py Initial commit Oct 11, 2017
dqlearning.py Initial commit Oct 11, 2017
model.h5 Initial commit Oct 11, 2017
model.json Initial commit Oct 11, 2017
moodyman.py Initial commit Oct 11, 2017

README.md

Deep-Moody-Man

Deep Q-Learning Network with Keras (Theano backend) to play the Moody Man.

I refer a lot to yanpanlau's code here https://github.com/yanpanlau/Keras-FlappyBird/blob/master/README.md. Thanks yanpanlau!

You can refer to some info about Q-learning in my blog: https://blog.bkbklim.com/2017/10/11/deep-moody-man/, or watch this video to see the AI in action :D https://www.youtube.com/watch?v=ryjJUGzDZ_8

Python 2.7
Keras==2.0.3
pygame==1.9.3
scikit-image==0.13.1
Theano==0.9.0

I have the following config in my ~/.keras/keras.json to run Theano as backend

{
    "epsilon": 1e-07,
    "floatx": "float32",
    "image_data_format": "channels_last",
    "backend": "theano",
    "image_dim_ordering": "th"
}

How to use this repo

clone this repo and cd into it, then

to run: python dqlearning -m Run
to train: python dqlearning -m Train

you can also specify a model file to be use for running. If the mode flag is Train it will continue to train based on the loaded model weight.

python dqlearning -m Train -f "models/model-90000.h5"

I don't have a GPU machine so I didn't try the GPU version before, sorry..