38c115e1bf3862010daf57107b90deee7626c8de,tests/agents_tests/test_ppo.py,TestPPO,_test_abc,#TestPPO#Any#Any#Any#Any#,60
Before Change
// Test
n_test_runs = 100
n_succeeded = 0
for _ in range(n_test_runs):
total_r = 0.0
obs = test_env.reset()
done = False
reward = 0.0
while not done:
action = agent.act(obs)
obs, reward, done, _ = test_env.step(action)
total_r += reward
agent.stop_episode()
if np.isclose(total_r, successful_return):
n_succeeded += 1
if require_success:
self.assertGreater(n_succeeded, 0.8 * n_test_runs)
// Save
After Change
// Test
n_test_runs = 100
eval_returns = run_evaluation_episodes(
test_env,
agent,
n_runs=n_test_runs,
max_episode_len=max_episode_len,
)
n_succeeded = np.sum(np.asarray(eval_returns) >= successful_return)
if require_success:
self.assertGreater(n_succeeded, 0.8 * n_test_runs)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 20
Instances
Project Name: chainer/chainerrl
Commit Name: 38c115e1bf3862010daf57107b90deee7626c8de
Time: 2018-10-09
Author: muupan@gmail.com
File Name: tests/agents_tests/test_ppo.py
Class Name: TestPPO
Method Name: _test_abc
Project Name: chainer/chainerrl
Commit Name: d5e51a64f3dad62ec34a726da2d357c6d135f890
Time: 2018-10-09
Author: muupan@gmail.com
File Name: tests/agents_tests/test_a2c.py
Class Name: TestA2C
Method Name: _test_abc
Project Name: chainer/chainerrl
Commit Name: a4f6690b9c4290a7f47761100523ff2ef5335964
Time: 2019-04-28
Author: muupan@gmail.com
File Name: tests/agents_tests/test_trpo.py
Class Name: TestTRPO
Method Name: _test_abc