d5e51a64f3dad62ec34a726da2d357c6d135f890,tests/agents_tests/test_a2c.py,TestA2C,_test_abc,#TestA2C#Any#Any#Any#Any#,57

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 = batch_run_evaluation_episodes(
            test_env,
            agent,
            n_runs=n_test_runs,
        )
        n_succeeded = np.sum(np.asarray(eval_returns) >= successful_return)
        if require_success:
            self.assertGreater(n_succeeded, 0.8 * n_test_runs)

        // Save
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 18

Instances


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: c5fc920ac8b81b753108f712c4e3babb2b2df64b
Time: 2018-10-09
Author: muupan@gmail.com
File Name: tests/agents_tests/test_ppo.py
Class Name: TestBatchPPO
Method Name: _test_abc


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