ReplayBufferFactory
Factory for creating replay buffers based on their configuration.
Methods
create
python
create(config: ReplayBufferConfiguration, observation_shape: tuple[int, ...], observation_dtype: np.dtype) -> ReplayBufferCreate a replay buffer from the given configuration.
Parameters:
config(ReplayBufferConfiguration) – The replay buffer configuration.observation_shape(tuple[int, ...]) – The shape of the observations.observation_dtype(dtype) – The numpy dtype for storing observations.
Returns:
ReplayBuffer– The created replay buffer.
estimate_memory_usage
python
estimate_memory_usage(config: ReplayBufferConfiguration, observation_shape: tuple[int, ...], observation_dtype: np.dtype, is_per: bool = False) -> intEstimate the memory usage of a replay buffer in bytes.
Parameters:
config(ReplayBufferConfiguration) – The replay buffer configuration.observation_shape(tuple[int, ...]) – The shape of the observations.observation_dtype(dtype) – The numpy dtype for storing observations.is_per(bool) – Whether this is a Prioritized Experience Replay buffer.
Returns:
int– Estimated memory usage in bytes.