In this chapter, you will learn how to use R to implement reinforcement learning techniques within a maze environment. In particular, we will create an agent to solve a maze by training the agent to perform actions and learn from failed attempts. We will learn how to define the maze environment and configure the agent to travel through it. We will also be adding neural networks to Q-learning. This provides us with an alternative way of getting the value for all the state-action pairs. We are going to iterate over our model numerous times to create the policy to get through the maze.
This chapter will cover the following topics:
- Creating an environment for reinforcement learning
- Defining an agent to perform actions
- Building a deep Q-learning model
- Running the experiment
- Improving performance with policy functions