Defining an agent to perform actions

In this section, we will define our agent for deep Q-learning. We have already seen how the preceding environment functions define how the agent moves. Here, we define the agent itself. In the previous chapter, we used Q-learning and were able to apply the Bellman equation to the new state that was the result of a given action. In this chapter, we will augment that portion of Q-learning with a neural network, which is what takes standard Q-learning and makes it deep Q-learning.

In order to add this neural network model to the process, we need to define a class. This is something that is often done in object-oriented programming; however, it is done less often in a programming language such as R. To accomplish ...

Get Hands-On Deep Learning with R now with O’Reilly online learning.

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