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

Adding initial interface for backend and redis pubsub (#19)

* Adding initial interface for backend and redis pubsub

* Addressing comments, adding super in all memories

* Removing distributed experience replay
This commit is contained in:
Ajay Deshpande
2018-10-03 15:07:48 -07:00
committed by zach dwiel
parent a54ef2757f
commit 6b2de6ba6d
21 changed files with 459 additions and 444 deletions

View File

@@ -0,0 +1,21 @@
from rl_coach.memories.backend.memory import MemoryBackendParameters
from rl_coach.memories.backend.redis import RedisPubSubBackend, RedisPubSubMemoryBackendParameters
def get_memory_backend(params: MemoryBackendParameters):
backend = None
if type(params) == RedisPubSubMemoryBackendParameters:
backend = RedisPubSubBackend(params)
return backend
def construct_memory_params(json: dict):
if json['store_type'] == 'redispubsub':
memory_params = RedisPubSubMemoryBackendParameters(
json['redis_address'], json['redis_port'], channel=json.get('channel', ''), run_type=json['run_type']
)
return memory_params