15 Q-function
Q-learning is off-policy (learns about a different policy than the one it uses to choose actions during training).
The behaviour policy is -greedy, so % of the time it takes a random action. This is a deliberately suboptimal, exploratory policy.
The target policy is full greedy (
np.max) and takes the best possible action from regardless if the action to get there is random.
The Q values converge to the optimal Q values - the values corresponding to always acting greedily - even though the agent spent training acting suboptimally due to exploration.