Training an agent using the keras-rl library is very easy:
- Define the policy you want the training to follow. We will be using the epsilon-greedy policy. The equivalent of this in the DQN section would be the agent action function. To know more about other policies, visit https://github.com/keras-rl/keras-rl/blob/master/rl/policy.py.
- Load the agent you would like to use. In this case, the SARSA agent has a lot of parameters of which the important ones that need to be defined are model, nb_actions, and policy. model is the deep learning agent you have defined in the preceding code, nb_actions is the number of possible actions in the system, and policy is your preferred choice of policy to train the SARSA agent.
- We compile ...