Coder Social home page Coder Social logo

q-learning's Introduction

Maze-solver with Q-learning and Q-vizualisation.

This is a maze-solver using Q-learning. Main purpose of the project is to visualize agent Q-matrix. The Q- and R- matrices of the agent are built up during the exploration. The agent sends actions to the maze, and the maze replies with the reward. E.g. the agent starts at the position 1, with 2x2 Q- and R-matrices corresponding to the zeroth (not allowed move) position, and first (starting) position. When the agent steps into a not visited cell, its Q- and R- matrices expand by one row+column creating links to the new position. Zeros on the screen are then replaced by the calculated real Q values. Zero Q values on the screen are for visualization purposes only, in the ´brains´ of the agent they do not exist until explored.

Other notes:

  1. I cheated a bit by making the agent to link all moves that are not allowed (e.g. inner/outer walls) to the agent position 0. E.g. if a cell has three walls, the agent sees all of them as one link.
  2. The animation starts only after the calculation is finished.
  3. Note that the maze is generated in a very simple way by randomizing walls positions, so agent and the goal could be locked away from each other.

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.