This repository implements various machine learning algorithms from scratch using Python.
The results of this project help create the reinforcement learning available in BeatShot today. You can see how this was implmented in C++ here.
- Algos.py: Implements Sarsa and Q-Learning reinforcement learning algorithms.
- ExperimentLoop.py: Creates the custom Gymnasium environment, ML_RL_Env and uses algorithms from Algos.py.
- FileModHandler.py: Watches for changes to a given file and executes a callback when modified.
- LiveGameExperiment.py: Uses FileModHandler to watches for changes to the
Accuracy.csv
file, and updates the QTable when modified. This was created so that BeatShot could write to this file. - ML_RL_Env.py: Creates a custom Gymnasium environment using a static player accuracy matrix. PyGame is built into the environment, and you can watch the environment change rewards at locations during iteration by specifying
render_mode='human'
. - Report.pdf: A report for the project containing a full explanation, analysis, and conclusions for the project.