Implementing Bellman equations

We're starting with a simplified Bellman equation for the first part of our code: 

Note that we are only including gamma in this equation at the moment. We'll include alpha and epsilon in later iterations. Let's assume we're choosing a value of 0.1 for gamma. 

This is what that equation looks like in Python:

Q[state,action] = reward + gamma * np.max(Q[next_state])

If you're a Python programmer, but not a mathematician, this version is probably much less intimidating than the math version, but it works exactly the same way. Let's go through each part of this equation. 

This is an assignment where we are setting ...

Get Hands-On Q-Learning with Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.