yawning_titan.envs.generic.core.action_loops#
The ActionLoop
class helps reduce boilerplate code when evaluating an agent within a target environment.
Serves a similar function to library helpers such as Stable Baselines 3 ``evaluate_policy()”.
Classes
A class that represents different post-training action loops for agents. |
- class yawning_titan.envs.generic.core.action_loops.ActionLoop(env, agent, filename=None, episode_count=None)[source]#
A class that represents different post-training action loops for agents.
Initialise Class.
- Parameters:
env – The environment to run through
agent – The agent to run in the environment
filename – The save name for the action lop
episode_count – The number of episodes to go through
- __init__(env, agent, filename=None, episode_count=None)[source]#
Initialise Class.
- Parameters:
env – The environment to run through
agent – The agent to run in the environment
filename – The save name for the action lop
episode_count – The number of episodes to go through
- gif_action_loop(render_network=True, prompt_to_close=False, save_gif=False, save_webm=False, deterministic=False, gif_output_directory=None, webm_output_directory=None, *args, **kwargs)[source]#
Run the agent in evaluation and create a gif from episodes.
- Parameters:
render_network – Bool to toggle rendering on or off. Has a default value of True.
prompt_to_close – Bool to toggle if the output window should close immediately on loop ending
save_gif – Bool to toggle if gif file should be saved to AppData
save_webm – Bool to toggle if webm file should be saved to AppData
deterministic – Bool to toggle if the agents actions should be deterministic
gif_output_directory – Directory where the GIF will be output
webm_output_directory – Directory where the WEBM file will be output
- standard_action_loop(deterministic=False)[source]#
Indefinitely act within the environment using a trained agent.