Skip to content

Latest commit

 

History

History
47 lines (31 loc) · 1.12 KB

README.md

File metadata and controls

47 lines (31 loc) · 1.12 KB

reinforcement-learning

This repository contains code for a SARSA reinforcement learning agent using tiled Q-tables for solving the Cart Pole problem.

Getting started

The agent can be run with Python. Follow the below steps to get started.

Create a virtual environment and install dependencies

It is recommended to create a Python virtual environment when installing the dependencies. This can be done as follows:

python3 -m venv env

Then, activate the virtual environment

source env/bin/activate

Finally, install the requirements from requirements.txt:

pip install -r requirements.txt

Run the agent

The entrypoint of the program is in main.py. This is also where all parameters are kept. Feel free to change these in order to achieve as good results as possible.

To start the agent, run the following command:

python main.py

This will output the maximum score reached every 100th iteration. When the training terminates, the score for each iteration is plotted.

Q-learning scores