Skip to content

Commit 024d696

Browse files
committed
Allow multi-process test to complete.
1 parent 5146326 commit 024d696

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/RLTrader.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,11 @@ def test(self, model_epoch: int = 0, should_render: bool = True):
223223
self.logger.info(f'Testing model ({self.study_name}__{model_epoch})')
224224

225225
state = None
226-
obs, done, rewards = test_env.reset(), [False], []
227-
while not all(done):
226+
obs, rewards = test_env.reset(), []
227+
228+
for _ in range(len(test_provider.data_frame)):
228229
action, state = model.predict(obs, state=state)
229-
obs, reward, done, _ = test_env.step(action)
230+
obs, reward, _, __ = test_env.step(action)
230231

231232
rewards.append(reward)
232233

0 commit comments

Comments
 (0)