Code Monkey home page Code Monkey logo

rl-algorithms's Introduction

RL-algorithms

Value Iteration

I implemented value iteration in the Frozen-Lake environment from OpenAI Gym. The environment is structured as a grid-world, either 4x4 or 8x8 in size. As an agent in this environment, my objective is to navigate through this grid by moving up, down, left, or right. The ultimate goal is to reach a designated point while avoiding any pitfalls, represented as holes in the grid.

In the Frozen-Lake environment, the reward system is straightforward. Successfully reaching the goal earns me a reward of +1. However, if I make a misstep and fall into a hole, I receive a -1 reward. For all other moves that neither result in reaching the goal nor falling into a hole, there's a minimal penalty of -0.1, which represents the cost of each step taken in the environment. Here is the pseudocode:

val

SARSA

In the context of Value Iteration, it's typically assumed that we have knowledge of the environment's transition model, denoted as p(sā€²,r|s,a). However, there are situations where this model isn't known. In such cases, we turn to a different approach known as model-free Reinforcement Learning (RL). An example of this, which was discussed in the lectures, is the Q-learning algorithm, a form of model-free learning.

For this specific task, I'm focusing on implementing SARSA, another type of model-free method. The SARSA algorithm's methodology is quite intriguing and differs from the Q-learning approach. After completing the implementation, my objective is to analyze and report the final policies developed in both environments. Here is the pseudocode:

Sarsa

Results

Value Iteration

valResult

Sarsa

SarsaResult

Policy Comparison

PolicyComp

rl-algorithms's People

Contributors

gamgrant avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.