class_docstr: Evaluates Meta-RL algorithms on test environments.
  
  Args:
      test_task_sampler (TaskSampler): Sampler for test
          tasks. To demonstrate the effectiveness of a meta-learning method,
          these should be different from the training tasks.
      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_eps (int): Number of episodes to gather from the
          exploration policy before requesting the meta algorithm to produce
          an adapted policy.
      n_test_episodes (int): Number of episodes to use for each adapted
          policy. The adapted policy should forget previous episodes 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.
class_docstr_tok: ["Evaluates","Meta-RL","algorithms","on","test","environments",".","Args",":","test_task_sampler","(","TaskSampler",")",":","Sampler","for","test","tasks",".","To","demonstrate","the","effectiveness","of","a","meta-learning","method",",","these","should","be","different","from","the","training","tasks",".","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_eps","(","int",")",":","Number","of","episodes","to","gather","from","the","exploration","policy","before","requesting","the","meta","algorithm","to","produce","an","adapted","policy",".","n_test_episodes","(","int",")",":","Number","of","episodes","to","use","for","each","adapted","policy",".","The","adapted","policy","should","forget","previous","episodes","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","."]
code: def __init__(
      self,
      *,
      test_task_sampler,
      n_exploration_eps=10,
      n_test_tasks=None,
      n_test_episodes=1,
      prefix="MetaTest",
      test_task_names=None,
      worker_class=DefaultWorker,
      worker_args=None,
  ):
      self._test_task_sampler = test_task_sampler
      self._worker_class = worker_class
      if worker_args is None:
          self._worker_args = {}
      else:
          self._worker_args = worker_args
      if n_test_tasks is None:
          n_test_tasks = test_task_sampler.n_tasks
      self._n_test_tasks = n_test_tasks
      self._n_test_episodes = n_test_episodes
      self._n_exploration_eps = n_exploration_eps
      self._eval_itr = 0
      self._prefix = prefix
      self._test_task_names = test_task_names
      self._test_sampler = None
      self._max_episode_length = None
  
imports: from dowel import logger, tabular
  from garage import EpisodeBatch, log_multitask_performance
  from garage.experiment.deterministic import get_seed
  from garage.sampler import DefaultWorker, LocalSampler, WorkerFactory
label_desc: Use image node_id 1 to create a new MetaEvaluator object  with example: obj = MetaEvaluator()