1
0
mirror of https://github.com/gryf/coach.git synced 2026-01-31 04:55:50 +01:00

Remove double call to reset_internal_state() on gym environments (#364)

This commit is contained in:
Gal Leibovich
2019-07-02 13:43:23 +03:00
committed by GitHub
parent a576ab5659
commit 587b74e04a
2 changed files with 4 additions and 6 deletions

View File

@@ -16,6 +16,7 @@ def atari_env():
seed=1,
frame_skip=4,
visualization_parameters=VisualizationParameters())
env.reset_internal_state(True)
return env
@@ -26,6 +27,7 @@ def continuous_env():
seed=1,
frame_skip=1,
visualization_parameters=VisualizationParameters())
env.reset_internal_state(True)
return env
@@ -56,7 +58,7 @@ def test_gym_continuous_environment(continuous_env):
assert np.all(continuous_env.action_space.shape == np.array([1]))
# make sure that the seed is working properly
assert np.sum(continuous_env.last_env_response.next_state['observation']) == 1.2661630859028832
assert np.sum(continuous_env.last_env_response.next_state['observation']) == 0.6118565010687202
@pytest.mark.unit_test
@@ -64,4 +66,4 @@ def test_step(atari_env):
result = atari_env.step(0)
if __name__ == '__main__':
test_gym_continuous_environment(continuous_env())
test_gym_continuous_environment(continuous_env())