Trait border_core::Batch
source · [−]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
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).