Beispiel #1
0
 def test_double_dqn(self):
     env = VectorEnv("CartPole-v0")
     algo = DoubleDQN("mlp", env, batch_size=5, replay_size=100)
     assert isinstance(algo.model, MlpValue)
     trainer = OffPolicyTrainer(
         algo,
         env,
         log_mode=["csv"],
         logdir="./logs",
         max_ep_len=200,
         epochs=4,
         warmup_steps=10,
         start_update=10,
     )
     trainer.train()
     shutil.rmtree("./logs")
Beispiel #2
0
 def test_double_dqn(self):
     env = VectorEnv("Pong-v0", env_type="atari")
     algo = DoubleDQN("cnn", env, batch_size=5, replay_size=100, value_layers=[1, 1])
     assert isinstance(algo.model, CnnValue)
     trainer = OffPolicyTrainer(
         algo,
         env,
         log_mode=["csv"],
         logdir="./logs",
         max_ep_len=200,
         epochs=4,
         warmup_steps=10,
         start_update=10,
         max_timesteps=100,
     )
     trainer.train()
     shutil.rmtree("./logs")