Skip to content

jwt2706/snake-rl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game Reinforcement Learning

This was just a fun little project to train a simple reinforcement learning model to play the classic snake game. Basically it's just +10 reward for eating an apple and -10 reward for dying. The game is made with pygame, and I ran 1000 games to see how good the model would get over that time. Here are the training results:

Training Results

The best score was 85, but it seemed to average at around 35-ish. It started to figure out the zigzag technique at around 400 games or so which was pretty interesting to see.

Training Video

I might to tetris next hmmmm idk

Training

Just setup a venv and run train.py. You can change MAX_GAMES in that file if you wanna train for longer.

About

Cool little reinforcement learning project for the snake game [!website]

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages