Skip to content

Apply Policy Networks to play the game of Snake using Tenorflow

Notifications You must be signed in to change notification settings

louismartin/deep-snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep Snake

This repo is a adaptation of Deep Policy Networks to play the game of Snake. It has been coded in Python using Tensorflow. To get started, you can have a look at our iPython notebook.

Below is a short demo. Note that the Snake dos not eat the fruit in the first place to avoid being trapped and loose the game. Have fun !

  1. Setup

  2. Playing around

  3. Going further

Setup

You can find the requirements in the file requirements.txt. All coding files can be found in the snake folder.

Playing around

We implemented a simple snake envioronment (snake.py). To play it yourself and try to beat the best AI score, simply run

python demo_snake.py

We also implemented the policy network algorithm as described in our report in the file policy_gradient.py. You can try your own network structure (folder models). The pretrained weights are avilable in the weights folder (there is a warm_restart argument to the training function) and the output graphs are available in the graphs folder. To try our implementation, simply run

python demo_policy.py

Going further

The detailed theoretical explanations, the setup parameters and experimental results can be found in the report folder.

About

Apply Policy Networks to play the game of Snake using Tenorflow

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published