Skip to content

Sed-Miyuki/DQN_SNAKE_GAME_AI

Repository files navigation

DQN Agent Snake Game

This project contains the four main files:

  1. snake_env.py : Run this and you can play the game Snake by yourself
  2. agent_1.py : Run this and a Deep Reinforcement Learning Agent will learn to play snake
  3. plot_script.py : Plotting the results of the agent
  4. requirements.txt : You will need some Python packages, like turtle, TensorFlow and Keras before you can run the scripts, install these first

Having a close look at Agent

  1. The first games, the agent has no clue:

first_game

  1. End of game 13 and beginning of game 14: The agent learns, it doesn’t take the shortest path but finds his way to the apples.

middle_game

  1. Game 30: The agent avoids the body of the snake and finds a fast way to the apples, after playing only 30 games.

end_game

Looking at the learning curve of one of the Run

LR-CURVE

About

Training a DQN to play the famous Snake Game

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages