Skip to content

Commit

Permalink
[0.6.5.3] stop put exps when testing mode
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjim0816 committed Jun 18, 2024
1 parent 836403e commit ac5dcdc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions joyrl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
Email: [email protected]
Date: 2023-01-01 16:20:49
LastEditor: JiangJi
LastEditTime: 2024-06-17 14:44:33
LastEditTime: 2024-06-18 08:56:38
Discription:
'''
from joyrl import algos, framework, envs
from joyrl.run import run

__version__ = "0.6.5.2"
__version__ = "0.6.5.3"

__all__ = [
"algos",
Expand Down
4 changes: 3 additions & 1 deletion joyrl/framework/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Email: [email protected]
Date: 2023-12-22 23:02:13
LastEditor: JiangJi
LastEditTime: 2024-06-14 09:34:14
LastEditTime: 2024-06-18 08:56:04
Discription:
'''
import time
Expand Down Expand Up @@ -35,6 +35,8 @@ def _t_start(self):
def run(self):
sample_data_len = 0
while True:
if not (self.cfg.mode.lower() == 'train'):
break
exps = exec_method(self.sample_data_que, 'pop', 'get')
if exps:
sample_data_len += len(exps)
Expand Down
4 changes: 2 additions & 2 deletions joyrl/framework/interactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Email: [email protected]
Date: 2024-02-25 15:46:04
LastEditor: JiangJi
LastEditTime: 2024-06-14 21:04:30
LastEditTime: 2024-06-18 08:51:47
Discription:
'''
import copy
Expand Down Expand Up @@ -125,7 +125,7 @@ def run(self):
exec_method(self.policy_mgr, 'pub_msg', 'remote', Msg(type = MsgType.POLICY_MGR_PUT_MODEL_META, data = (self.name, model_meta)))
self.ep_reward, self.ep_step = 0, 0
self.curr_obs, self.curr_info = self.env.reset(seed = self.seed)
self._put_exps()
if self.cfg.mode.lower == "train": self._put_exps()
run_step += 1
if run_step >= self.n_sample_steps:
break

0 comments on commit ac5dcdc

Please sign in to comment.