yawning_titan.envs.generic.core.action_loops.ActionLoop#
- class yawning_titan.envs.generic.core.action_loops.ActionLoop(env, agent, filename=None, episode_count=None)[source]#
Bases:
object
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
Methods
Generate GIF from images.
Create webm from image files.
Run the agent in evaluation and create a gif from episodes.
Indefinitely act within the environment taking random actions.
Delete the frames image files.
Indefinitely act within the environment using a trained agent.
- 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.