Tetris AI bot using custom DQN (Deep Q-learning network)
javac -cp "./lib/*;." @tetris.srcs
java -cp "./lib/*;." edu.bu.tetris.MainThere are several command line options available to you. If you want to see the exhausive list, please add a -h or --help argument to the command line and see the help message! Most of these command line arguments are your way of configuring the way you train your model (such as learning rate, batch size, etc.).
The hyperparameters we ended up going with
java -cp "./lib/*;." edu.bu.tetris.Main -q src.pas.tetris.agents.TetrisQAgent -p 10000 -t 400 -v 200 -b 10000 -n 0.001 -g 0.99 -c 10000000 -u 5 -s | tee run.log change the iteration to the latest iteration model trained
java -cp "./lib/*;." edu.bu.tetris.Main -a src.pas.tetris.agents.TetrisQAgent -i ./params/qFunction<iteration>.modelsrc/pas/tetris/agents/TetrisQAgent.java
Feed Forward Neural Network. 1 input layer, 1 hidden layer, 1 output layer
Input layer 37 nodes
- Height of each column
- Closest hole from top for each column
- Number of hole following it for each column
- Next 3 minos types
- Number of lines cleared for this move
- Total holes below the maximum height
- Tetris for this move
- T spin for this move
Hidden layer
- 64 nodes
Output layer
- 1 node representing the q value of this move
Reward function: -0.51 * height - 0.36 * holes - 0.18 * bumpiness + 7 * game.getScoreThisTurn();