Code Monkey home page Code Monkey logo

cilff-problem's Introduction

Cliff problem

Introduction

Q-learning, Sarsa, n-step Sarsa, Sarsa(lambda) in a 4x12 grid world cliff walking problem in Decision Making Under Uncertainty - Theory and Application.

A undiscounted, episodic task, with start and goal states, and the usual actions causing movement up, down, right, and left. Reward is -1 on all transitions except those into the region marked β€œThe Cliff.” Stepping into this region incurs a reward of -100 and sends the agent instantly back to the start.

How to run

  • Set the mode in main as Qlearning_Sarsa_comparison / Nstep_Sarsa / Sarsa_Lambda ro run different tasks.
  • Set episode_num and rounds in line 189, 190 to determine the number of episodes and iterations.

Results

Comparison between Q-learning and Sarsa

The figure below shows the reward when rounds = 500, episode_num = 500, learning_rate = 0.1, gamma = 1, epsilon = 0.1

The chosen path in Q-learning and Sarsa.

n-step Sarsa

The chosen path in n-step Sarsa when rounds = 1000, n = 1,3,5, learning_rate = 0.1, gamma = 1, epsilon = 0.1. As we can see, when n = 1, the chosen path is the same as Sarsa.

Sarsa(lambda)

The chosen path in Sarsa(lambda) when rounds = 1000, Lambda = 0,0.5,1, learning_rate = 0.1, gamma = 1, epsilon = 0.1

cilff-problem's People

Contributors

lllllh76 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.