ray.rllib.utils.replay_buffers.reservoir_replay_buffer.ReservoirReplayBuffer#

class ray.rllib.utils.replay_buffers.reservoir_replay_buffer.ReservoirReplayBuffer(capacity: int = 10000, storage_unit: str = 'timesteps', **kwargs)[source]#

Bases: ray.rllib.utils.replay_buffers.replay_buffer.ReplayBuffer

This buffer implements reservoir sampling.

The algorithm has been described by Jeffrey S. Vitter in “Random sampling with a reservoir”.

Methods

__init__([capacity, storage_unit])

Initializes a ReservoirBuffer instance.

add(batch, **kwargs)

Adds a batch of experiences or other data to this buffer.

apply(func, *args, **kwargs)

Calls the given function with this rollout worker instance.

get_host()

Returns the computer's network name.

get_state()

Returns all local state.

ping()

Ping the actor.

sample([num_items])

Samples num_items items from this buffer.

set_state(state)

Restores all local state to the provided state.

stats([debug])

Returns the stats of this buffer.