Member-only story
First Steps in the World Of Reinforcement Learning using Python
Original Python implementation of how to find the best places to be in one of the fundamental worlds of reinforcement learning — the grid world
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.