tensorforce.execution package

Submodules

tensorforce.execution.runner module

class tensorforce.execution.runner.Runner(agent, environment, repeat_actions=1, history=None)

Bases: object

Simple runner for non-realtime single-process execution.

reset(history=None)
run(timesteps=None, episodes=None, max_episode_timesteps=None, deterministic=False, episode_finished=None)

Runs the agent on the environment.

Parameters:
  • timesteps (int) – Max. number of total timesteps to run (across episodes).
  • episodes (int) – Max. number of episodes to run.
  • max_episode_timesteps (int) – Max. number of timesteps per episode.
  • deterministic (bool) – If true, pick actions from model without exploration/sampling.
  • episode_finished (callable) – Function handler taking a Runner argument and returning a boolean indicating whether to continue execution. For instance, useful for reporting intermediate performance or integrating termination conditions.

tensorforce.execution.threaded_runner module

class tensorforce.execution.threaded_runner.ThreadedRunner(agents, environments, repeat_actions=1, save_path=None, save_episodes=None)

Bases: object

Runner for non-realtime threaded execution of multiple agents.

run(episodes=-1, max_episode_timesteps=-1, episode_finished=None, summary_report=None, summary_interval=0, max_timesteps=None)
Parameters:
  • episodes (List[Episode]) –
  • max_episode_timesteps (int) – Max. number of timesteps per episode.
  • episode_finished (callable) –
  • summary_report (callable) – Function that produces a tensorboard summary update.
  • summary_interval (int) –
  • max_timesteps (int) – Deprecated; see max_episode_timesteps
tensorforce.execution.threaded_runner.WorkerAgentGenerator(agent_class)

Worker Agent generator, receives an Agent class and creates a Worker Agent class that inherits from that Agent.

Module contents

class tensorforce.execution.Runner(agent, environment, repeat_actions=1, history=None)

Bases: object

Simple runner for non-realtime single-process execution.

reset(history=None)
run(timesteps=None, episodes=None, max_episode_timesteps=None, deterministic=False, episode_finished=None)

Runs the agent on the environment.

Parameters:
  • timesteps (int) – Max. number of total timesteps to run (across episodes).
  • episodes (int) – Max. number of episodes to run.
  • max_episode_timesteps (int) – Max. number of timesteps per episode.
  • deterministic (bool) – If true, pick actions from model without exploration/sampling.
  • episode_finished (callable) – Function handler taking a Runner argument and returning a boolean indicating whether to continue execution. For instance, useful for reporting intermediate performance or integrating termination conditions.
class tensorforce.execution.ThreadedRunner(agents, environments, repeat_actions=1, save_path=None, save_episodes=None)

Bases: object

Runner for non-realtime threaded execution of multiple agents.

run(episodes=-1, max_episode_timesteps=-1, episode_finished=None, summary_report=None, summary_interval=0, max_timesteps=None)
Parameters:
  • episodes (List[Episode]) –
  • max_episode_timesteps (int) – Max. number of timesteps per episode.
  • episode_finished (callable) –
  • summary_report (callable) – Function that produces a tensorboard summary update.
  • summary_interval (int) –
  • max_timesteps (int) – Deprecated; see max_episode_timesteps