pub trait Batch {
    type ObsBatch;
    type ActBatch;
    fn unpack(
        self
    ) -> (Self::ObsBatch, Self::ActBatch, Self::ObsBatch, Vec<f32>, Vec<i8>, Option<Vec<usize>>, Option<Vec<f32>>);
fn len(&self) -> usize;
fn obs(&self) -> &Self::ObsBatch;
fn act(&self) -> &Self::ActBatch;
fn next_obs(&self) -> &Self::ObsBatch;
fn reward(&self) -> &Vec<f32>;
fn is_done(&self) -> &Vec<i8>;
fn weight(&self) -> &Option<Vec<f32>>;
fn ix_sample(&self) -> &Option<Vec<usize>>; }
Expand description

A batch of samples.

It is used to train agents.

Associated Types

A set of observation in a batch.

A set of observation in a batch.

Required methods

Unpack the data (o_t, a_t, o_t+1, r_t, is_done_t).

Optionally, the return value has sample indices in the replay buffer and thier weights. Those are used for prioritized experience replay (PER).

Returns the number of samples in the batch.

Returns o_t.

Returns a_t.

Returns o_t+1.

Returns r_t.

Returns is_done_t.

Returns weight. It is used for PER.

Returns ix_sample. It is used for PER.

Implementors