trpo_cartpole_recurrent

This is an example to train a task with TRPO algorithm.

It uses an LSTM-based recurrent policy.

Here it runs CartPole-v1 environment with 100 iterations.

Results:

AverageReturn: 100 RiseTime: itr 13

trpo_cartpole_recurrent(ctxt, seed, n_epochs, batch_size, plot)

Train TRPO with a recurrent policy on CartPole.

Parameters
  • ctxt (garage.experiment.ExperimentContext) – The experiment configuration used by Trainer to create the snapshotter.

  • n_epochs (int) – Number of epochs for training.

  • seed (int) – Used to seed the random number generator to produce determinism.

  • batch_size (int) – Batch size used for training.

  • plot (bool) – Whether to plot or not.