Skip to content

Commit

Permalink
Allow multi-process test to complete.
Browse files Browse the repository at this point in the history
  • Loading branch information
notadamking committed Jul 6, 2019
1 parent 5146326 commit 024d696
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/RLTrader.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,11 @@ def test(self, model_epoch: int = 0, should_render: bool = True):
self.logger.info(f'Testing model ({self.study_name}__{model_epoch})')

state = None
obs, done, rewards = test_env.reset(), [False], []
while not all(done):
obs, rewards = test_env.reset(), []

for _ in range(len(test_provider.data_frame)):
action, state = model.predict(obs, state=state)
obs, reward, done, _ = test_env.step(action)
obs, reward, _, __ = test_env.step(action)

rewards.append(reward)

Expand Down

0 comments on commit 024d696

Please sign in to comment.