pub struct PrioritizedBurnTensors<B: Backend> {
pub observations: Tensor<B, 2>,
pub actions: Tensor<B, 1, Int>,
pub rewards: Tensor<B, 1>,
pub next_observations: Tensor<B, 2>,
pub dones: Tensor<B, 1>,
pub is_weights: Tensor<B, 1>,
}Expand description
Bundle of Burn tensors produced by PrioritizedBatch::to_burn_tensors.
Adds the per-sample importance-sampling weights on top of the
ReplayBurnTensors field set. The trainer multiplies the per-row
TD-error magnitude by is_weights before reducing to a scalar loss
— this is the bias correction described in Schaul et al. §3.4.
Fields§
§observations: Tensor<B, 2>Observations, shape [batch, obs_dim], dtype f32.
actions: Tensor<B, 1, Int>Discrete actions, shape [batch], dtype i64.
rewards: Tensor<B, 1>Rewards, shape [batch], dtype f32.
next_observations: Tensor<B, 2>Bootstrap-state observations, shape [batch, obs_dim], dtype f32.
dones: Tensor<B, 1>Episode-terminal mask (0.0 or 1.0), shape [batch], dtype f32.
is_weights: Tensor<B, 1>Importance-sampling weights, shape [batch], dtype f32,
normalized so the max element is 1.0.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for PrioritizedBurnTensors<B>where
<B as BackendTypes>::IntTensorPrimitive: Freeze,
<B as BackendTypes>::FloatTensorPrimitive: Freeze,
<B as BackendTypes>::QuantizedTensorPrimitive: Freeze,
impl<B> RefUnwindSafe for PrioritizedBurnTensors<B>where
<B as BackendTypes>::IntTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::FloatTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: RefUnwindSafe,
impl<B> Send for PrioritizedBurnTensors<B>
impl<B> Sync for PrioritizedBurnTensors<B>
impl<B> Unpin for PrioritizedBurnTensors<B>where
<B as BackendTypes>::IntTensorPrimitive: Unpin,
<B as BackendTypes>::FloatTensorPrimitive: Unpin,
<B as BackendTypes>::QuantizedTensorPrimitive: Unpin,
impl<B> UnsafeUnpin for PrioritizedBurnTensors<B>where
<B as BackendTypes>::IntTensorPrimitive: UnsafeUnpin,
<B as BackendTypes>::FloatTensorPrimitive: UnsafeUnpin,
<B as BackendTypes>::QuantizedTensorPrimitive: UnsafeUnpin,
impl<B> UnwindSafe for PrioritizedBurnTensors<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
Mutably borrows from an owned value. Read more
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>
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