Skip to content

Greenpp/Snake-DQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake DQL

Description

Deep Q-Learning on Snake game, implemented with PyTorch Lightning and Kivy visualization.

Design

The results shown below were created with a model consisting of 2 hidden layers, both with 256 nodes, 11 input nodes, and 3 output nodes.

As an input binary vector was used, including 4 values for current snake movement direction, 4 values for food orientation based on snakes head, and 3 values for immediate danger around snakes head.

The output corresponds to 3 actions: turn left, go straight, turn right.

Results

Untrained model:

Untrained

After 2.5 min of training (10 000 iterations):

Trained

About

Deep Q Learning with Snake game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages