Skip to content

ArchiMickey/QMario

Repository files navigation

Description

QMario is a personal project to train an AI agent playing the SuperMarioBros. The environment is created by OpenAI gym. The specification of the environment can be found here. The framework of this project is Pytorch Lightning.

Model

The neural network is just a simple double deep q network. The replay buffer is a multistep replay buffer.

Getting started

You can install all the dependencies by using qmario.yml with conda.

Use train.py to start training.

Use test.py to test the trained model. You need to edit the checkpoint path in test.py by yourself.

Hint: You can add save_video=True when constructing the model to save videos. Don't forget to specify the value of fps. Due to the limitation of MoviePy, you need to create the folder first if you want to put the videos in a folder.

Result

Double Deep Q Network:

image

mario_episode0_reward6230.0.mp4

About

AI playing Super Mario Bros

Topics

Resources

Stars

Watchers

Forks

Languages