1
0
mirror of https://github.com/gryf/coach.git synced 2025-12-18 19:50:17 +01:00

use the number of heat up steps specified in schedule parameters

This commit is contained in:
Zach Dwiel
2018-09-19 13:10:31 -04:00
committed by zach dwiel
parent 98850464cc
commit 5e85a0f972

View File

@@ -13,6 +13,15 @@ from rl_coach.memories.memory import MemoryGranularity
# Q: specify alternative distributed memory, or should this go in the preset? # 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. # 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):
memory = DistributedExperienceReplay(max_size=(MemoryGranularity.Transitions, 1000000),
redis_ip=graph_manager.agent_params.memory.redis_ip,
redis_port=graph_manager.agent_params.memory.redis_port)
num_steps = graph_manager.schedule_params.heatup_steps.num_steps
while(memory.num_transitions() < num_steps):
time.sleep(10)
def training_worker(graph_manager, checkpoint_dir): def training_worker(graph_manager, checkpoint_dir):
""" """
@@ -26,17 +35,8 @@ def training_worker(graph_manager, checkpoint_dir):
# save randomly initialized graph # save randomly initialized graph
graph_manager.save_checkpoint() graph_manager.save_checkpoint()
memory = DistributedExperienceReplay(max_size=(MemoryGranularity.Transitions, 1000000), # optionally wait for a specific number of transitions to be in memory before training
redis_ip=graph_manager.agent_params.memory.redis_ip, heatup(graph_manager)
redis_port=graph_manager.agent_params.memory.redis_port)
while(memory.num_transitions() < 100):
time.sleep(10)
# 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
# training loop # training loop
for _ in range(40): for _ in range(40):