From 04f32a0f02a9baaaa1676b8ebb138f25b6d904a3 Mon Sep 17 00:00:00 2001 From: Zach Dwiel Date: Tue, 18 Sep 2018 19:55:09 +0000 Subject: [PATCH] add heatup step to training worker --- rl_coach/training_worker.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/rl_coach/training_worker.py b/rl_coach/training_worker.py index 534729b..d2445e6 100644 --- a/rl_coach/training_worker.py +++ b/rl_coach/training_worker.py @@ -10,6 +10,13 @@ from rl_coach.utils import short_dynamic_import # Q: specify alternative distributed memory, or should this go in the preset? # A: preset must define distributed memory to be used. we aren't going to take a non-distributed preset and automatically distribute it. + +def heatup(graph_manager): + num_steps = graph_manager.schedule_params.heatup_steps.num_steps + while len(graph_manager.agent_params.memory) < num_steps: + time.sleep(1) + + def training_worker(graph_manager, checkpoint_dir): """ restore a checkpoint then perform rollouts using the restored model @@ -22,11 +29,12 @@ def training_worker(graph_manager, checkpoint_dir): # save randomly initialized graph graph_manager.save_checkpoint() - # TODO: critical: wait for minimum number of rollouts in memory before training # TODO: Q: training steps passed into graph_manager.train ignored? # TODO: specify training steps between checkpoints (in preset?) - # TODO: replace while true with what? number of steps, convergence, time, ... - # TODO: low: move evaluate out of this process + # TODO: replace outer training loop with something general + # TODO: low priority: move evaluate out of this process + + heatup(graph_manager) # training loop for _ in range(10):