Skip to content

Commit b57efb4

Browse files
author
Mohammad Babaeizadeh
committed
this fixes #24
1 parent ff1c6a2 commit b57efb4

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

ga3c/ProcessAgent.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,8 @@ def run_episode(self):
107107
terminal_reward = 0 if done else value
108108

109109
updated_exps = ProcessAgent._accumulate_rewards(experiences, self.discount_factor, terminal_reward)
110-
if len(updated_exps) == 0:
111-
yield None, None, None, total_reward
112-
else:
113-
x_, r_, a_ = self.convert_data(updated_exps)
114-
yield x_, r_, a_, reward_sum
110+
x_, r_, a_ = self.convert_data(updated_exps)
111+
yield x_, r_, a_, reward_sum
115112

116113
# reset the tmax count
117114
time_count = 0
@@ -131,8 +128,6 @@ def run(self):
131128
total_length = 0
132129
for x_, r_, a_, reward_sum in self.run_episode():
133130
total_reward += reward_sum
134-
if x_ is None:
135-
break
136131
total_length += len(r_) + 1 # +1 for last frame that we drop
137132
self.training_q.put((x_, r_, a_))
138133
self.episode_log_q.put((datetime.now(), total_reward, total_length))

0 commit comments

Comments
 (0)