Skip to content

A tabular reinforcement learning approach to a custom & classic gridworld setting

License

Notifications You must be signed in to change notification settings

arijitnoobstar/FrozenLake_RL

Repository files navigation

FrozenLake_RL

This project provides the code for a Reinforcement Learning agent to learn to navigate any N by M gridworld. The gridworld consists empty slot where an agent can go to, and holes which terminate the path of the agent. The aim is to reach the goal without falling into any holes. Any attempt to leave the gridworld border will force the agent to stay in the same spot. The state transition function for all states is deterministic and follows the agent's intended movement (i.e. if the agent wishes to move left, it will move left with 100% probability). The image below shows an example of a 4 by 4 gridworld.

The following tabular reinforcement learning algorithms are supported for this gridworld:

  1. Q Learning
  2. SARSA
  3. First-Visit Monte-Carlo with Exploring Starts
  4. Every-Visit Monte-Carlo with Exploring Starts
  5. First-Visit Monte-Carlo without Exploring Starts
  6. Every-Visit Monte-Carlo without Exploring Starts

The image below shows an example of a policy learnt via Q-Learning for the 4 by 4 gridworld

The following features are also supported for a custom N by M gridworld:

  1. Generate a gridworld of specified N and M
  2. Choose the probability of a grid cell being a hole (randomly generated)
  3. Choose the starting locations of agent and goal
  4. Depth-First search to ensure random gridworld has a valid path from agent to goal
  5. Custom epsilon schedule to manage the balance between exploration & exploitation

The images below show the examples of a custom 10 by 10 gridworld & policy,

The following post-processing plots can also be derived

All instructions for using the code can be found in the .IPYNB file in this repository

Collaborators

Arijit Dasgupta

About

A tabular reinforcement learning approach to a custom & classic gridworld setting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published