class Plotter(env, policy, sess=None, graph=None, rollout=default_rollout)

Visualizes episodes of the policy as it trains.

Usually, this class is used by sending plot=True to Trainer.train().

  • env (garage.Environment) – Environment from which to visualize episodes. This will be used without copying in the current process but in a separate thread, so it should be given a unique copy (in particular, do not pass the training environment here, then try to pickle it, or you will occasionally get crashes).

  • policy ( – Policy used to visualize episodes.

  • sess (tf.Session) – The TensorFlow session to use.

  • graph (tf.Graph) – The TensorFlow graph to use.

  • rollout (callable) – The rollout function to call.


Stop the Plotter’s worker thread.

static get_plotters()

Return all’s.


All the’s

Return type



Start the Plotter’s worker thread.

update_plot(policy, max_length=np.inf)

Update the policy being plotted.

  • policy ( – Policy to visualize.

  • max_length (int or float) – The maximum length to allow an episode to be. Defaults to infinity.