Skip to content

Implementation of Q-Learning using TD error to navigate a maze avoiding obstacles and a moving enemy

Notifications You must be signed in to change notification settings

PierpaoloLucarelli/QLearningMaze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

q-learning td error

Goal: Reaching the yellow oval while avoiding black blocks and moving enemy (red block)

QLearningMaze

Implementation of Q-Learning usind TD error for optimally navigating a maze while avoiding a moving enemy.

To run:

$ pip install numpy pandas
$ python main.py

Project comes with trained Qtable in pickled file action You may run in the following ways

Importing Q-table and running optimal policy

$ python main.py

Training

$ python main.py --test

Training + GUI

(slow, mostly for debugging)

$ python main.py --test --vis

Algorithm used

Q-values are updated based on the following formula: q-learning td error

pseudo formula

newVal = oldVal + learningRate * (reward + discount_val * maxValOfNextState - oldVal)

About

Implementation of Q-Learning using TD error to navigate a maze avoiding obstacles and a moving enemy

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages