Light Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ZYunfeii/DRL4SnakeGame

Repository files navigation

DRL4SnakeGame

Using deep reinforcement learning to play Snake game(Tan Chi She ).

The used algorithm is PPO for discrete! It has the brilliant performance in the field of discrete action space just like in continuous action space.

You just need half an hour to train the snake and then it can be as smart as you.

Result

File to Illustrate

Agent.py: file to store the algorithm.

core.py: file to store the net for DRL algorithm.

draw.py: file to draw the reward curve.

env4Snake.py: the environment for snake game.

main.py: the main func.

what you need to do is to run the main.py and then run the env4Snake to test your mdoel!

Requirements

  1. torch
  2. numpy
  3. seaborn==0.11.1
  4. pygame==2.0.1
  5. matplotlib==3.2.2
  6. PIL(This is unimportant. I do not use this package in running process.)

Details for realization

See my blog for details: https://blog.csdn.net/weixin_43145941/article/details/118639211

About

Using deep reinforcement learning to play Snake game(Tan Chi She ).

Topics

Resources

Readme

License

MIT license

Stars

Watchers

Forks

Packages

Contributors

Languages