Parallel runner

class tensorforce.execution.ParallelRunner(agent, environment=None, num_parallel=None, environments=None, max_episode_timesteps=None, evaluation_environment=None, save_best_agent=None)[source]

Tensorforce parallel runner utility.

Parameters:
  • agent (specification | Agent object) – Agent specification or object, the latter is not closed automatically as part of runner.close() (required).
  • environment (specification | Environment object) – Environment specification or object, the latter is not closed automatically as part of runner.close() (required, or alternatively environments).
  • num_parallel (int > 0) – Number of parallel environment instances to run (required, or alternatively environments).
  • environments (list[specification | Environment object]) – Environment specifications or objects, the latter are not closed automatically as part of runner.close() (required, or alternatively environment and num_parallel).
  • max_episode_timesteps (int > 0) – Maximum number of timesteps per episode, overwrites the environment default if defined (default: environment default).
  • evaluation_environment (specification | Environment object) – Evaluation environment or object, the latter is not closed automatically as part of runner.close() (default: none).
  • save_best_agent (string) – Directory to save the best version of the agent according to the evaluation (default: best agent is not saved).