Skip to content

iarslankhalid/RL_snake_game

Repository files navigation

Snake Game with Reinforcement Learning

Description

Snake Game with Reinforcement Learning is a project that combines classic game development with artificial intelligence. The Snake game is implemented using the Pygame library, and an AI agent is trained to play the game using the Q-learning algorithm powered by PyTorch. The goal is to showcase the implementation of a reinforcement learning algorithm in a gaming environment.

Features

  • Snake Game: Classic Snake game implemented using Pygame.
  • Reinforcement Learning: Q-learning algorithm applied for training an AI agent.
  • PyTorch Integration: Utilizing PyTorch for neural network implementation.
  • Flexible and Extendable: Easily extendable for experimenting with different algorithms or game modifications.

Installation

  1. Clone the repository:
    git clone https://github.com/iarslankhalid/RL_snake_game.git
    cd RL_snake_game
    pip install -r requirements.txt
    

Usage

  1. Setup: Complete all the Installation process
  2. Run agent.py file
  3. You can use the pre-trained parameters by setting LOAD_PREVIOUS_MODEL = True in model.py
  4. Or you can train the snake from start.
  5. Explore & Experiment:
    • Tweak parameters and configurations in model.py for customization.
    • Extend the project by implementing additional features or experimenting with different reinforcement learning algorithms.

Licence

This project is licence under MIT Licence

Contact

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages