Sitemap
TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Member-only story

First Steps in the World Of Reinforcement Learning using Python

15 min readJan 13, 2023

--

Gridworld matrices; Photo by author

The purpose of this article is to present fundamental concepts and definitions in Reinforcement Learning (from here on — RL) using Python code and comments.

The article was heavily inspired by the great RL course: https://www.coursera.org/learn/fundamentals-of-reinforcement-learning

The theory is laid out in the book¹: http://www.incompleteideas.net/book/RLbook2020.pdf

The code for all my RL experiments can be seen in my Gitlab repo: https://github.com/Eligijus112/rl-snake-game

The grid world problem is a classic problem in RL where we want to create an optimal strategy for an agent to traverse a grid.

A grid is a square matrix of cells, and the agent can move in any of the four directions (up, down, left, right) in each cell. The agent receives a reward of -1 for each step it takes, and a reward of +10 if it reaches the goal cell. The numbers for the rewards are arbitrary and can be defined by the user.

--

--

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Eligijus Bujokas
Eligijus Bujokas

Written by Eligijus Bujokas

A person who tries to understand the world through data and equations