All Projects β†’ YuriyGuts β†’ Snake Ai Reinforcement

YuriyGuts / Snake Ai Reinforcement

Licence: mit
AI for Snake game trained from pixels using Deep Reinforcement Learning (DQN).

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Snake Ai Reinforcement

Aigames
use AI to play some games.
Stars: ✭ 422 (+243.09%)
Mutual labels:  ai, game, reinforcement-learning, dqn
Atari
AI research environment for the Atari 2600 games πŸ€–.
Stars: ✭ 174 (+41.46%)
Mutual labels:  ai, reinforcement-learning, dqn
Doudizhu
AIζ–—εœ°δΈ»
Stars: ✭ 149 (+21.14%)
Mutual labels:  ai, reinforcement-learning, dqn
Pygame Learning Environment
PyGame Learning Environment (PLE) -- Reinforcement Learning Environment in Python.
Stars: ✭ 828 (+573.17%)
Mutual labels:  ai, game, reinforcement-learning
Cartpole
OpenAI's cartpole env solver.
Stars: ✭ 107 (-13.01%)
Mutual labels:  ai, reinforcement-learning, dqn
Rlcard
Reinforcement Learning / AI Bots in Card (Poker) Games - Blackjack, Leduc, Texas, DouDizhu, Mahjong, UNO.
Stars: ✭ 980 (+696.75%)
Mutual labels:  ai, game, reinforcement-learning
Reinforcement learning
Reinforcement learning tutorials
Stars: ✭ 82 (-33.33%)
Mutual labels:  reinforcement-learning, dqn
Reinforcement Learning Wechat Jump
Reinforcement Learning for WeChat Jump
Stars: ✭ 85 (-30.89%)
Mutual labels:  ai, reinforcement-learning
Categorical Dqn
A working implementation of the Categorical DQN (Distributional RL).
Stars: ✭ 90 (-26.83%)
Mutual labels:  reinforcement-learning, dqn
Torchrl
Highly Modular and Scalable Reinforcement Learning
Stars: ✭ 102 (-17.07%)
Mutual labels:  reinforcement-learning, dqn
09 Zombierunner Original
First person shooter with Unity terrain and AI pathfinding (http://gdev.tv/cudgithub)
Stars: ✭ 64 (-47.97%)
Mutual labels:  ai, game
Openaigym
Solving OpenAI Gym problems.
Stars: ✭ 98 (-20.33%)
Mutual labels:  reinforcement-learning, dqn
Reinforcement Learning
πŸ€– Implements of Reinforcement Learning algorithms.
Stars: ✭ 104 (-15.45%)
Mutual labels:  reinforcement-learning, dqn
Snake
Artificial intelligence for the Snake game.
Stars: ✭ 1,241 (+908.94%)
Mutual labels:  game, reinforcement-learning
Warriorjs
🏰 An exciting game of programming and Artificial Intelligence
Stars: ✭ 8,673 (+6951.22%)
Mutual labels:  ai, game
Torchrl
Pytorch Implementation of Reinforcement Learning Algorithms ( Soft Actor Critic(SAC)/ DDPG / TD3 /DQN / A2C/ PPO / TRPO)
Stars: ✭ 90 (-26.83%)
Mutual labels:  reinforcement-learning, dqn
Mage
Magic Another Game Engine
Stars: ✭ 1,180 (+859.35%)
Mutual labels:  ai, game
Reinforcement learning
κ°•ν™”ν•™μŠ΅μ— λŒ€ν•œ 기본적인 μ•Œκ³ λ¦¬μ¦˜ κ΅¬ν˜„
Stars: ✭ 100 (-18.7%)
Mutual labels:  reinforcement-learning, dqn
Bwapi
Brood War API
Stars: ✭ 1,482 (+1104.88%)
Mutual labels:  ai, game
Ctc Executioner
Master Thesis: Limit order placement with Reinforcement Learning
Stars: ✭ 112 (-8.94%)
Mutual labels:  reinforcement-learning, dqn

snake-ai-reinforcement

AI for Snake game trained from pixels using Deep Reinforcement Learning (DQN).

Contains the tools for training and observing the behavior of the agents, either in CLI or GUI mode.

Requirements

All modules require Python 3.6 or above. Note that support for Python 3.7 in TensorFlow is experimental at the time of writing, and requirements may need to be updated as new official versions get released.

Training on GPU is supported but disabled by default. If you have CUDA and would like to use a GPU, use the GPU version of TensorFlow by changing tensorflow to tensorflow-gpu in the requirements file.

To install all Python dependencies, run:

$ make deps

Pre-Trained Models

You can find a few pre-trained DQN agents on the Releases page. Pass the model file to the play.py front-end script (see play.py -h for help).

  • dqn-10x10-blank.model

    An agent pre-trained on a blank 10x10 level (snakeai/levels/10x10-blank.json).

  • dqn-10x10-obstacles.model

    An agent pre-trained on a 10x10 level with obstacles (snakeai/levels/10x10-obstacles.json).

Training a DQN Agent

To train an agent using the default configuration, run:

$ make train

The trained model will be checkpointed during the training and saved as dqn-final.model afterwards.

Run train.py with custom arguments to change the level or the duration of the training (see train.py -h for help).

Playback

The behavior of the agent can be tested either in batch CLI mode where the agent plays a set of episodes and outputs summary statistics, or in GUI mode where you can see each individual step and action.

To test the agent in batch CLI mode, run the following command and check the generated .csv file:

$ make play

To use the GUI mode, run:

$ make play-gui

To play on your own using the arrow keys (I know you want to), run:

$ make play-human

Running Unit Tests

$ make test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].