Skip to content

Trained an artificial intelligence agent using reinforcement learning to play a simple version of the game "Snake". Implemented a Temporal Difference version of the Q-learning Algorithm. Completed for school.

Notifications You must be signed in to change notification settings

JeffreyTsa1/rl_task

Repository files navigation

rl_task

Trained an artificial intelligence agent using reinforcement learning to play a simple version of the game "Snake". Implemented a Temporal Difference version of the Q-learning Algorithm.

This project was changed since I took this class but if you're here to copy code pls don't! Our university has great cheat detection, and you will likely get caught. Thanks to my fellow TAs/instructor for making this awesome assignment.

There are a few ways to run this code. Before you do, make sure you have Python3, Pygame, Numpy, and any other required libraries installed. Thanks so much!

To run, navigate to this repository in your terminal and then run the commands in the quotation marks below.

Trains snake agent, Ricky, for 1000 games and then simulates 10 games for Ricky to play. Takes average score from 10 games.

"python snake_task.py"

Play the game yourself using the keyboard

"python snake_task.py --human"

About

Trained an artificial intelligence agent using reinforcement learning to play a simple version of the game "Snake". Implemented a Temporal Difference version of the Q-learning Algorithm. Completed for school.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages