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:
learningrate
discountfactor
epsilon
minepsilong
depsilong
- Withing
start_rl.py
, the training method can be chosen. Seelib/Learning.py
for how to instantiate:Deep Q Learner
(default)Q-Learner
SarsaLearner
SarsaLambdaLearner
- Simply type
- Continue training:
- The script
start_rl.py
automatically looks for policies of namepolicy-*.pickle
and continues the most recent by default.
- The script
- Watch an agent play:
- Change the variable
DRAW
withinstart_rl.py
toTrue
.
- Change the variable
- Adjust the Tetris environment within
start_rl.py
and 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.