Giter Club home page Giter Club logo

q-learning's Introduction

q-learning

A screenshot of the interface

A small app that simulates a bot finding its path on a map using q-learning.

Goals:

I made this game to test my understanding of Q-Learning. As a side effect it allowed me to learn how to do GUI in tkinter. I made it quickly, so there's a lot to improve.

Launch and Installation:

python3 main.py

If you encounter an error regarding tkinter, you might have to install it. On Ubuntu:

sudo apt install python-tk python-imaging-tk python3-tk

Usage:

You will be asked to choose a map file at launch, chose a default one or one you made. Then you can tinker with the parameter (I recommend to launch with an high exploration rate - 0.5/0.8 - to find new paths).

Creating maps:

You can create new maps by creating a file with the .map extension and fill it this way:

  • 0 is a blank tile
  • 1 is a reward tile
  • 2 is a penalty tile
  • X is an inacessible tile. A line in the file corresponds to a line in the app. Currently the starting point can only be at (0, 2).

TODO:

Lots of things to do:

  • refactor the code. It's awful currently
  • Allow the user to modify the learning rate or the gamma value.
  • Allow the user to move the dot
  • Open the map in the windows, not only at launch.
  • A mode to display the path with arrow pointing towards the best action.
  • The formula I found favor the propagation of "good" path, and doesn't propagate the "bad" one at all. I'm not sure it's optimal as the AI will keep going on the bad path even if it got a lot of bad rewards there. Maybe I should modify it to propagate the most extreme action instead of the one that brings the most value ...?

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.