Beispiel #1
0
 def test_callback_single(self):
     for backend in get_backends(PpoAgent):
         env._StepCountEnv.clear()
         agent = PpoAgent(_env_name, backend=backend)
         agent.train(duration._SingleEpisode())
         assert env._StepCountEnv.reset_count <= 2
Beispiel #2
0
 def test_play_plotstate(self):
     agent = agents.PpoAgent("CartPole-v0")
     agent.train([duration._SingleEpisode()])
     agent.play([plot.State()])
Beispiel #3
0
 def test_single_episode(self):
     agent = agents.PpoAgent("CartPole-v0")
     count=log._CallbackCounts()
     agent.train([duration._SingleEpisode(), log._Callbacks(), count])
     assert count.train_iteration_begin_count == 1