Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleSnakeDQN

License

This repo adopts MIT License

About

This repo stores a simple DQN snake game agent training program

demo.gif

Environment

  • Install pygame for game environment simulation
pip3/conda/pip install pygame
  • Install pytorch for DQN model training, where CPU training is enough for this agent
pip3 install torch torchvision
  • Install matplotlib and ipython to help display the training results
pip3/conda/pip install matplotlib ipython
  • After installing all the dependencies, run the agent.py to start new training task
cd your_project_dir\Agent
python Agent.py
  • If you encounter the following error, install nomkl package in your conda environment
OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized
conda install nomkl

Improvement

The snake agent will frequently crash into its own body then end the game, the reason is that the agent is unaware of the position info about the snake body because of the state design, thus unconscious to reduce the risk of crashing into itself

About

A simple snake game agent using DQN for fun

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages