Implements the simplest deep reinforcement learner for Tetris based on the Google DeepMind paper Playing Atari with Deep Reinforcement Learning including
- pyglet
- theano
- lasagne
- Training an agent:
- Simply type
python start_rl.py - Hyperparameters can be adjusted in the same file line 71. Please consult the Google DeepMind paper for further information on these parameters:
learningratediscountfactorepsilonminepsilongdepsilong
- Withing
start_rl.py, the training method can be chosen. Seelib/Learning.pyfor how to instantiate:Deep Q Learner(default)Q-LearnerSarsaLearnerSarsaLambdaLearner
- Simply type
- Continue training:
- The script
start_rl.pyautomatically looks for policies of namepolicy-*.pickleand continues the most recent by default.
- The script
- Watch an agent play:
- Change the variable
DRAWwithinstart_rl.pytoTrue.
- Change the variable
- Adjust the Tetris environment within
start_rl.pyand the type of blocks inlib/Shape.py- Note that the classical Tetris environment (board size of 14x20 and classical block types) are very difficult to get to convergence as the possibility of scoring is extremely small.
The Tetris framework was originally created by Charles Leifer.
Visit https://github.com/coleifer/tetris
The deep reinforcement learning code by Nathan Sprague inspired the implementation for this project.