This is a bonus recipe in this chapter, where we will solve the CartPole problem using FA.
As we saw in Chapter 1, Getting started with reinforcement learning and PyTorch, we simulated the CartPole environment in the , Simulating the CartPole environment recipe, and solved the environment using random search, and the hill climbing and policy gradient algorithms, respectively, in recipes including Implementing and evaluating the random search policy, Developing the hill climbing algorithm, and Developing the policy gradient algorithm. Now, let's try to solve CartPole using what we've talked about in this chapter.