Testing/evaluating RL agents
Let’s assume that you have trained the SAC agent in one of the trading environments using the training script (previous recipe) and that you have several versions of the trained agent models, each with different policy network architectures or hyperparameters or your own tweaks and customizations to improve its performance. When you want to deploy an agent, you want to make sure that you pick the best performing agent, don’t you?
This recipe will help you build a lean script to evaluate a given pre-trained agent model locally so that you can get a quantitative performance assessment and compare several trained models before choosing the right agent model for deployment. Specifically, we will use the tradegym
module and the sac_agent_runtime
module that we built earlier in this chapter to evaluate the agent models that we train.
Let’s get started!
Getting ready
To complete this recipe, you will first need to activate the...