class_docstr: Base class of trainer.
  
  Use trainer.setup(algo, env) to setup algorithm and environment for trainer
  and trainer.train() to start training.
  
  Args:
      snapshot_config (garage.experiment.SnapshotConfig): The snapshot
          configuration used by Trainer to create the snapshotter.
          If None, it will create one with default settings.
  
  Note:
      For the use of any TensorFlow environments, policies and algorithms,
      please use TFTrainer().
  
  Examples:
      | # to train
      | trainer = Trainer()
      | env = Env(...)
      | policy = Policy(...)
      | algo = Algo(
      |         env=env,
      |         policy=policy,
      |         ...)
      | trainer.setup(algo, env)
      | trainer.train(n_epochs=100, batch_size=4000)
  
      | # to resume immediately.
      | trainer = Trainer()
      | trainer.restore(resume_from_dir)
      | trainer.resume()
  
      | # to resume with modified training arguments.
      | trainer = Trainer()
      | trainer.restore(resume_from_dir)
      | trainer.resume(n_epochs=20)
docstr: Resume from restored experiment.
  
  This method provides the same interface as train().
  
  If not specified, an argument will default to the
  saved arguments from the last call to train().
  
  Args:
      n_epochs (int): Number of epochs.
      batch_size (int): Number of environment steps in one batch.
      plot (bool): Visualize an episode from the policy after each epoch.
      store_episodes (bool): Save episodes in snapshot.
      pause_for_plot (bool): Pause for plot.
  
  Raises:
      NotSetupError: If resume() is called before restore().
  
  Returns:
      float: The average return in last epoch cycle.
docstr_tok: ["Resume","from","restored","experiment",".","This","method","provides","the","same","interface","as","train","(",")",".","If","not","specified",",","an","argument","will","default","to","the","saved","arguments","from","the","last","call","to","train","(",")",".","Args",":","n_epochs","(","int",")",":","Number","of","epochs",".","batch_size","(","int",")",":","Number","of","environment","steps","in","one","batch",".","plot","(","bool",")",":","Visualize","an","episode","from","the","policy","after","each","epoch",".","store_episodes","(","bool",")",":","Save","episodes","in","snapshot",".","pause_for_plot","(","bool",")",":","Pause","for","plot",".","Raises",":","NotSetupError",":","If","resume","(",")","is","called","before","restore","(",")",".","Returns",":","float",":","The","average","return","in","last","epoch","cycle","."]
code: def resume(
      self,
      n_epochs=None,
      batch_size=None,
      plot=None,
      store_episodes=None,
      pause_for_plot=None,
  ):
      """Resume from restored experiment.
  
      This method provides the same interface as train().
  
      If not specified, an argument will default to the
      saved arguments from the last call to train().
  
      Args:
          n_epochs (int): Number of epochs.
          batch_size (int): Number of environment steps in one batch.
          plot (bool): Visualize an episode from the policy after each epoch.
          store_episodes (bool): Save episodes in snapshot.
          pause_for_plot (bool): Pause for plot.
  
      Raises:
          NotSetupError: If resume() is called before restore().
  
      Returns:
          float: The average return in last epoch cycle.
  
      """
      if self._train_args is None:
          raise NotSetupError(
              "You must call restore() before resume()."
          )
  
      self._train_args.n_epochs = n_epochs or self._train_args.n_epochs
      self._train_args.batch_size = (
          batch_size or self._train_args.batch_size
      )
  
      if plot is not None:
          self._train_args.plot = plot
      if store_episodes is not None:
          self._train_args.store_episodes = store_episodes
      if pause_for_plot is not None:
          self._train_args.pause_for_plot = pause_for_plot
  
      average_return = self._algo.train(self)
      self._shutdown_worker()
  
      return average_return
  
imports: import copy
  import os
  import time
  import cloudpickle
  from dowel import logger, tabular
  from garage.experiment.deterministic import get_seed, set_seed
  from garage.experiment.experiment import dump_json
  from garage.experiment.snapshotter import Snapshotter
label_desc: Use image node_id 12 for calling the Trainer obj's underlying member method code with example usage: obj.resume(n_epochs, batch_size, plot, store_episodes, pause_for_plot) and returns: average_return