garage.tf.plotter.plotter module

Renders rollouts of the policy as it trains.

class Plotter(env, policy, sess=None, graph=None, rollout=<function rollout>)[source]

Bases: object

Renders rollouts of the policy as it trains.

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

Parameters:
  • env (gym.Env) – The environment to perform rollouts in. This will be
  • without copying in the current process but in a separate thread, (used) –
  • it should be given a unique copy (in particular, do not pass the (so) –
  • here, then try to pickle it, or you will occasionally get (environment) –
  • crashes)
  • policy (garage.tf.Policy) – The policy to do the rollouts with.
  • sess (tf.Session) – The TensorFlow session to use.
  • graph (tf.Graph) – The TensorFlow graph to use.
  • rollout (callable) – The rollout function to call.
close()[source]

Stop the Plotter’s worker thread.

static get_plotters()[source]

Return all garage.tf.Plotter’s.

Returns:All the garage.tf.Plotter’s
Return type:list[garage.tf.Plotter]
start()[source]

Start the Plotter’s worker thread.

update_plot(policy, max_length=inf)[source]

Update the policy being plotted.

Parameters:
  • policy (garage.tf.Policy) – The policy to rollout.
  • max_length (int or float) – The maximum length to allow a rollout to be. Defaults to infinity.