yantavares / snake-game-AI

AI that learns how to play the game Snake using reinforcement learning + graphical analysis and statistics in real time using Pygame and Pytorch.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SNAKE AI - Deep Q Reinforcement Learning 🐍

Introduction:

Snake AI is an advanced project that employs the Deep Q Reinforcement Learning algorithm to teach an AI how to play the classic Snake game. While the AI learns, the project provides a real-time visualization of the learning data using Matplotlib, and the game itself is built using Pygame.

Features:

  1. AI that learns to play Snake using Deep Q Reinforcement Learning.
  2. Real-time plotting of learning data with Matplotlib.
  3. Game interface built with Pygame.

Dependencies:

  • Python
  • PyTorch
  • Matplotlib
  • Pygame
  • Numpy

All required libraries and their specific versions can be found in requirements.txt.

Setup & Installation:

  1. Ensure you have Python installed on your system.
  2. Clone the repository:
git clone https://github.com/yantavares/snake-game-AI
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Run the program:
python agent.py

Usage:

Once you start the application, you'll see the Snake game being played by the AI. A separate window will show the real-time learning data plotted using Matplotlib. You can monitor the progress of the AI and observe its improvement over time.

Acknowledgements:

This project is 100% inspired in the FreeCodeCamp Course about the same topic. You can find the video at https://www.youtube.com/watch?v=L8ypSXwyBds

About

AI that learns how to play the game Snake using reinforcement learning + graphical analysis and statistics in real time using Pygame and Pytorch.


Languages

Language:Python 100.0%