Visualizing how different agents perceive their environment in the game Snake: Algorithms in Reinforcement Learning
The snake game environment is a visualization tool to evaluate different RL algorithms on the game Snake. the algorithms need to learn how to guide the snake to the food without hitting the wall or eating itself (self-loop). these algorithms do that by using image processing to create an input vector of values used in determining the best next step for the snake to play. each time the snake eats the food the algorithm gets a reward. the input vector has 3 values. each value defines the next step (forward, left, right). this is defined differently in each algorithm using state/action values.
-
Clone Repository
git clone https://github.com/YaadR/Visualizing_RL.git cd Visualizing_RL
-
Create Virtual Environment
python3 -m venv venv
-
Activate Environment
# Linux/MacOS source venv/bin/activate # Windows venv/Scripts/activate
-
Install requirements
pip install -r requirements.txt
-
Run Project
python3 Ver1\main.py
- Heatmap
- Certainty Arrows
- Neural network weights visualization (where NN is used)
- Certainty Bar (Entropy based)
- State Activation Layer
- Value-based: state value
- Model-based
- off policy
- online
RL Algorithm:
- Value-based: action value
- Model-free
- off policy
- online
RL Algorithm:
- Policy-based
- Model-free
- on policy
- online
RL Algorithm:
Critic:
Actor:
Please follow the project steps carefully and ensure that all dependencies are correctly installed before running the solution.
The basis for this project is inspired by Patrick Loeber for his work in Teach AI To Play Snake - Reinforcement Learning Tutorial With PyTorch And Pygame
This project is licensed under the MIT License. Feel free to use, modify, and distribute it according to the terms of the license.