Implementation of Q-Learning using TD error to navigate a maze avoiding obstacles and a moving enemy
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

q-learning td error

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


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

To run:

$ pip install numpy pandas
$ python

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

Importing Q-table and running optimal policy

$ python


$ python --test

Training + GUI

(slow, mostly for debugging)

$ python --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)