This Tensorflow Keras Model uses OpenAI's Gym Retro Eviroment to train an Agent via Deep Q Learning to play the Sega Genesis game StreetFighter II - Special Champion Edition.
These instructions help you set up the virtual env, install the requirements and set up the Retro Enviroment.
mkdir StreetFighterAI
- create virtual venv
python3 -m venv StreetFighterAI/
cd StreetFighterAI/
- clone the repo into the same folder that holds the venv
git clone git@github.com:bruder-grimm/ml.git
- activate the venv with
source bin/activate
After you set up the environment, you can get started with the training.
cd StreetFighterAI/
(unless you are already)- start venv (if you haven't already)
source bin/activate
- start training
./train.sh
- open tensorboard for monitoring
tensorboard --logdir Graph/
- go for lunch, then maybe dinner, and if you're as unlucky as we are even breakfast
This will generate two output models like model_weights_0.99_1.0_0.001_best.hdf5
and model_weights_0.99_1.0_0.001_last.hdf5
,
the latter of which just means that this is the last one saved, regardless of it's loss
(so best naturally is the one with the lowest loss).
Once you've trained for a sufficient amount of episodes, try your model by running
python play.py --model your_model.hdf5