pub trait ReplayBufferBase {
    type Config: Clone;
    type PushedItem;
    type Batch: Batch;
    fn build(config: &Self::Config) -> Self;
fn len(&self) -> usize;
fn batch(&mut self, size: usize) -> Result<Self::Batch>;
fn push(&mut self, tr: Self::PushedItem) -> Result<()>;
fn update_priority(
        &mut self,
        ixs: &Option<Vec<usize>>,
        td_err: &Option<Vec<f32>>
    ); }
Expand description

Interface of replay buffers.

Associated Types

Configuration of the replay buffer.

Items pushed into the buffer.

Batch generated from the buffer.

Required methods

Build a replay buffer from Self::Config.

The number of samples in the buffer.

Constructs a batch.

beta - The exponent for priority.

Pushes a transition into the buffer.

Updates priority.

Priority is commonly based on TD error.

Implementors