April 2019
Intermediate to advanced
212 pages
5h 34m
English
The choose_action function takes the current state of the agent and chooses an action based on the current values in the Q-table and the value of epsilon (it chooses a random action if a randomly chosen value is less than epsilon). Notice we're using model.predict() to retrieve the Q-values. This is a built-in Keras function.
Essentially, the CartPole task is a binary classification problem. The outputs are the two possible actions: left (0) and right (1).
The DQN provides updated estimates for the Q-values through the predict function. When the actual Q-values are provided and the loss backpropagates through the network, the network's weights are updated to reflect this new information about the Q-function. ...
Read now
Unlock full access