def test_run(self, bsuite_id: str): env = bsuite.load_from_id(bsuite_id) agent = actor_critic.default_agent(env.observation_spec(), env.action_spec()) experiment.run(agent=agent, environment=env, num_episodes=5)
def load(bsuite_id: Text, record: bool = True, save_path: Optional[Text] = None, logging_mode: Text = 'csv', overwrite: bool = False) -> py_environment.PyEnvironment: """Loads the selected environment. Args: bsuite_id: a bsuite_id specifies a bsuite experiment. For an example `bsuite_id` "deep_sea/7" will be 7th level of the "deep_sea" task. record: whether to log bsuite results. save_path: the directory to save bsuite results. logging_mode: which form of logging to use for bsuite results ['csv', 'sqlite', 'terminal']. overwrite: overwrite csv logging if found. Returns: A PyEnvironment instance. """ if record: raw_env = bsuite.load_and_record(bsuite_id=bsuite_id, save_path=save_path, logging_mode=logging_mode, overwrite=overwrite) else: raw_env = bsuite.load_from_id(bsuite_id=bsuite_id) gym_env = gym_wrapper.GymFromDMEnv(raw_env) return suite_gym.wrap_env(gym_env)
def test_run(self, bsuite_id: str): env = bsuite.load_from_id(bsuite_id) agent = boot_dqn.default_agent(env.observation_spec(), env.action_spec(), num_ensemble=2) experiment.run(agent=agent, environment=env, num_episodes=5)