/RL-snake_game

training an agent to play snake gale

Primary LanguagePython

Snake game played by an IA

Implementing and training a RL model to play a snake game using PyTorch

requirements: Python3!

pip install -r requirements.txt

Algorithm :

Q-Learning, from Bellman equation, Q'(s,a)= Q(s,a) + α(R(s,a) + γmax(Q(s',a')))

Q: Q value

R: Reward

α : learning rate

γ : parameter to controle the randomness < 1

Game

developed using Pygame: https://www.pygame.org/contribute.html

Screenshots

alt image 1

alt image 2

Thanks to @Python_engineer , and Thanks a lot to @FreeCodeCamp Community