Load and test an agent¶

This example shows how to load and test a trained agent.

Import required packages

import matplotlib.pyplot as plt
from rlenv.envs.wall.core import AccentaEnv
import rlagent

Load the agent

agent = rlagent.load_agent()
/usr/local/lib/python3.8/site-packages/gym/spaces/box.py:73: UserWarning: WARN: Box bound precision lowered by casting to float32
  logger.warn(
Wrapping the env with a `Monitor` wrapper
Wrapping the env in a DummyVecEnv.
/usr/local/lib/python3.8/site-packages/stable_baselines3/common/policies.py:458: UserWarning: As shared layers in the mlp_extractor are deprecated and will be removed in SB3 v1.8.0, you should now pass directly a dictionary and not a list (net_arch=dict(pi=..., vf=...) instead of net_arch=[dict(pi=..., vf=...)])
  warnings.warn(

Assess the agent

df = AccentaEnv.gen_one_episode(agent)
df.plot()
plt.show()
plot load and run agent
/usr/local/lib/python3.8/site-packages/gym/spaces/box.py:73: UserWarning: WARN: Box bound precision lowered by casting to float32
  logger.warn(

Total running time of the script: ( 0 minutes 12.278 seconds)

Gallery generated by Sphinx-Gallery