pub struct RolloutBurnTensors<B: Backend> {
pub observations: Tensor<B, 2>,
pub actions: Tensor<B, 1, Int>,
pub old_log_probs: Tensor<B, 1>,
pub old_values: Tensor<B, 1>,
pub advantages: Tensor<B, 1>,
pub returns: Tensor<B, 1>,
}Expand description
Bundle of Burn tensors produced by RolloutBatch::to_burn_tensors.
Fields are in the order PPO trainers consume them: policy/value
inputs first (observations, actions), then the old policy outputs
(log-probs and values used for the importance ratio and value clip),
then the GAE outputs (advantages and returns). Generic over the
backend B so the same trainer surface works for CPU (NdArray),
GPU (Wgpu, Cuda), and Autodiff<_> wrappers.
Fields§
§observations: Tensor<B, 2>Observations, shape [batch_size, obs_dim], dtype f32.
actions: Tensor<B, 1, Int>Discrete actions, shape [batch_size], dtype i64.
old_log_probs: Tensor<B, 1>Behavior-policy log-probabilities, shape [batch_size],
dtype f32.
old_values: Tensor<B, 1>Behavior-policy value estimates V(s_t), shape [batch_size],
dtype f32.
advantages: Tensor<B, 1>GAE advantages, shape [batch_size], dtype f32.
returns: Tensor<B, 1>Value-function targets (advantages + values), shape
[batch_size], dtype f32.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for RolloutBurnTensors<B>where
<B as BackendTypes>::IntTensorPrimitive: Freeze,
<B as BackendTypes>::FloatTensorPrimitive: Freeze,
<B as BackendTypes>::QuantizedTensorPrimitive: Freeze,
impl<B> RefUnwindSafe for RolloutBurnTensors<B>where
<B as BackendTypes>::IntTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::FloatTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: RefUnwindSafe,
impl<B> Send for RolloutBurnTensors<B>
impl<B> Sync for RolloutBurnTensors<B>
impl<B> Unpin for RolloutBurnTensors<B>where
<B as BackendTypes>::IntTensorPrimitive: Unpin,
<B as BackendTypes>::FloatTensorPrimitive: Unpin,
<B as BackendTypes>::QuantizedTensorPrimitive: Unpin,
impl<B> UnsafeUnpin for RolloutBurnTensors<B>where
<B as BackendTypes>::IntTensorPrimitive: UnsafeUnpin,
<B as BackendTypes>::FloatTensorPrimitive: UnsafeUnpin,
<B as BackendTypes>::QuantizedTensorPrimitive: UnsafeUnpin,
impl<B> UnwindSafe for RolloutBurnTensors<B>where
<B as BackendTypes>::IntTensorPrimitive: UnwindSafe,
<B as BackendTypes>::FloatTensorPrimitive: UnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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