The code in this repository is used to train agents to play snake using techniques from reinforcement learning. Tabular Q-learning and Value Function Approximation are implemented (using a simple Neural Network).
- pygame
python3 -m pip install -U pygame --user
- Clone the repository:
https://github.com/areevesman/reinforcement-learning-for-snake.git
cd reinforcemt-learning-for-snake
cd code
- To play snake:
python play_snake.py
- To train a snake with Q-learning:
python train_q_learning.py
- To train a snake with VFA:
python train_deep_q_learning.py
- Training output will be saved to a
results
folder in the working directory
- Adam Reevesman
- Evan Liu