garage.experiment.meta_evaluator module

Evaluator which tests Meta-RL algorithms on test environments.

class MetaEvaluator(*, test_task_sampler, max_path_length, n_exploration_traj=10, n_test_tasks=None, n_test_rollouts=1, prefix='MetaTest', test_task_names=None, worker_class=<class 'garage.sampler.default_worker.DefaultWorker'>, worker_args=None)[source]

Bases: object

Evaluates Meta-RL algorithms on test environments.

Parameters:
  • test_task_sampler (garage.experiment.TaskSampler) – Sampler for test tasks. To demonstrate the effectiveness of a meta-learning method, these should be different from the training tasks.
  • max_path_length (int) – Maximum path length used for evaluation trajectories.
  • n_test_tasks (int or None) – Number of test tasks to sample each time evaluation is performed. Note that tasks are sampled “without replacement”. If None, is set to test_task_sampler.n_tasks.
  • n_exploration_traj (int) – Number of trajectories to gather from the exploration policy before requesting the meta algorithm to produce an adapted policy.
  • n_test_rollouts (int) – Number of rollouts to use for each adapted policy. The adapted policy should forget previous rollouts when .reset() is called.
  • prefix (str) – Prefix to use when logging. Defaults to MetaTest. For example, this results in logging the key ‘MetaTest/SuccessRate’. If not set to MetaTest, it should probably be set to MetaTrain.
  • test_task_names (list[str]) – List of task names to test. Should be in an order consistent with the task_id env_info, if that is present.
  • worker_class (type) – Type of worker the Sampler should use.
  • worker_args (dict or None) – Additional arguments that should be passed to the worker.
evaluate(algo, test_rollouts_per_task=None)[source]

Evaluate the Meta-RL algorithm on the test tasks.

Parameters: