stable_learning_control.utils.eval_utils

Helper functions for evaluating the performance of trained agents.

Module Contents

Functions

test_agent(policy, env, num_episodes)

Evaluate the Performance of a agent in a separate test environment.

stable_learning_control.utils.eval_utils.test_agent(policy, env, num_episodes)[source]

Evaluate the Performance of a agent in a separate test environment.

Parameters:
  • policy (Union[torch.nn.Module, tf.Module]) – The policy you want to test.

  • env (gym.Env) – The environment in which you want to test the agent.

  • num_episodes (int) – The number of episodes you want to perform in the test environment.

Returns:

tuple containing:

  • ep_ret(list): Episode retentions.

  • ep_len(list): Episode lengths.

Return type:

tuple