mirror of
https://github.com/gryf/coach.git
synced 2025-12-17 19:20:19 +01:00
Make distributed coach work end-to-end.
- With data store, memory backend and orchestrator interfaces.
This commit is contained in:
committed by
zach dwiel
parent
9f92064e67
commit
844a5af831
@@ -30,7 +30,12 @@ from rl_coach.core_types import TotalStepsCounter, RunPhase, PlayingStepsType, T
|
||||
from rl_coach.environments.environment import Environment
|
||||
from rl_coach.level_manager import LevelManager
|
||||
from rl_coach.logger import screen, Logger
|
||||
<<<<<<< HEAD
|
||||
from rl_coach.utils import set_cpu, start_shell_command_and_wait
|
||||
=======
|
||||
from rl_coach.utils import set_cpu
|
||||
from rl_coach.data_stores.data_store_impl import get_data_store
|
||||
>>>>>>> Make distributed coach work end-to-end.
|
||||
|
||||
|
||||
class ScheduleParameters(Parameters):
|
||||
@@ -367,6 +372,11 @@ class GraphManager(object):
|
||||
"""
|
||||
self.verify_graph_was_created()
|
||||
|
||||
if hasattr(self, 'data_store_params') and hasattr(self.agent_params.memory, 'memory_backend_params'):
|
||||
if self.agent_params.memory.memory_backend_params.run_type == "worker":
|
||||
data_store = get_data_store(self.data_store_params)
|
||||
data_store.load_from_store()
|
||||
|
||||
# perform several steps of playing
|
||||
result = None
|
||||
|
||||
@@ -522,6 +532,11 @@ class GraphManager(object):
|
||||
self.checkpoint_id += 1
|
||||
self.last_checkpoint_saving_time = time.time()
|
||||
|
||||
if hasattr(self, 'data_store_params'):
|
||||
data_store = get_data_store(self.data_store_params)
|
||||
data_store.save_to_store()
|
||||
|
||||
|
||||
def improve(self):
|
||||
"""
|
||||
The main loop of the run.
|
||||
|
||||
Reference in New Issue
Block a user