1
0
mirror of https://github.com/gryf/coach.git synced 2025-12-17 19:20:19 +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

@@ -392,9 +392,6 @@ class GymEnvironment(Environment):
else:
screen.error("Error: Environment {} does not support human control.".format(self.env), crash=True)
# initialize the state by getting a new state from the environment
self.reset_internal_state(True)
# render
if self.is_rendered:
image = self.get_rendered_image()
@@ -405,7 +402,6 @@ class GymEnvironment(Environment):
self.renderer.create_screen(image.shape[1]*scale, image.shape[0]*scale)
# the info is only updated after the first step
self.state = self.step(self.action_space.default_action).next_state
self.state_space['measurements'] = VectorObservationSpace(shape=len(self.info.keys()))
if self.env.spec and custom_reward_threshold is None: