Skip to content

henrikig/reinforcement-learning

Repository files navigation

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

About

SARSA Q-learning agent for the Cart Pole problem🐍

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages