Skip to content

Commit

Permalink
more on NVlabs#4
Browse files Browse the repository at this point in the history
  • Loading branch information
hma02 committed May 30, 2017
1 parent f929bd7 commit 8f138bd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ga3c/ProcessStats.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def run(self):
first_time = datetime.now()
while self.exit_flag.value == 0:
try:
episode_time, reward, length = self.episode_log_q.get(timeout=2)
episode_time, reward, length = self.episode_log_q.get(timeout=0.1)
except:
continue

Expand Down
9 changes: 6 additions & 3 deletions ga3c/Server.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ def main(self):
self.stats.should_save_model.value = 0

time.sleep(0.01)


print('Finished. Exiting subprocesses ...')

self.stats.exit_flag.value = True
self.stats.join()
self.dynamic_adjustment.exit_flag = True
self.dynamic_adjustment.join()
while self.agents:
Expand All @@ -132,6 +136,5 @@ def main(self):
while self.trainers:
self.remove_trainer()

self.stats.exit_flag.value = True
self.stats.join()


2 changes: 1 addition & 1 deletion ga3c/ThreadPredictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def run(self):

while not self.exit_flag:
try:
ids[0], states[0] = self.server.prediction_q.get(timeout=2)
ids[0], states[0] = self.server.prediction_q.get(timeout=0.1)
except:
continue

Expand Down
2 changes: 1 addition & 1 deletion ga3c/ThreadTrainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def run(self):
batch_size = 0
while batch_size <= Config.TRAINING_MIN_BATCH_SIZE:
try:
x_, r_, a_ = self.server.training_q.get(timeout=2)
x_, r_, a_ = self.server.training_q.get(timeout=0.1)
except:
if self.exit_flag: break
continue
Expand Down

0 comments on commit 8f138bd

Please sign in to comment.