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:
committed by
zach dwiel
parent
a54ef2757f
commit
6b2de6ba6d
21
rl_coach/memories/backend/memory_impl.py
Normal file
21
rl_coach/memories/backend/memory_impl.py
Normal 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
|
||||
Reference in New Issue
Block a user