pub struct RolloutBatch {
pub observations: Vec<f32>,
pub actions: Vec<f32>,
pub rewards: Vec<f64>,
pub dones: Vec<f64>,
pub log_probs: Vec<f64>,
pub values: Vec<f64>,
pub advantages: Vec<f64>,
pub returns: Vec<f64>,
pub obs_dim: usize,
pub act_dim: usize,
pub n_steps: usize,
pub n_envs: usize,
}Expand description
A batch of rollout data ready for the learner.
All vectors are flat (row-major). For example, observations has length
n_steps * n_envs * obs_dim, laid out as [step0_env0, step0_env1, ..., step1_env0, ...].
Fields§
§observations: Vec<f32>Flat observations: [n_steps * n_envs * obs_dim].
actions: Vec<f32>Flat actions: [n_steps * n_envs * act_dim].
rewards: Vec<f64>Rewards: [n_steps * n_envs].
dones: Vec<f64>Done flags (0.0 or 1.0): [n_steps * n_envs].
log_probs: Vec<f64>Log-probabilities of the collected actions: [n_steps * n_envs].
values: Vec<f64>Value estimates at collection time: [n_steps * n_envs].
advantages: Vec<f64>GAE advantages: [n_steps * n_envs].
returns: Vec<f64>Discounted returns: [n_steps * n_envs].
obs_dim: usizeObservation dimensionality.
act_dim: usizeAction dimensionality.
n_steps: usizeNumber of time steps in this batch.
n_envs: usizeNumber of environments that contributed to this batch.
Trait Implementations§
Source§impl Clone for RolloutBatch
impl Clone for RolloutBatch
Source§fn clone(&self) -> RolloutBatch
fn clone(&self) -> RolloutBatch
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RolloutBatch
impl RefUnwindSafe for RolloutBatch
impl Send for RolloutBatch
impl Sync for RolloutBatch
impl Unpin for RolloutBatch
impl UnwindSafe for RolloutBatch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more