pub struct LstmBurnConfig {
pub hidden_dim: usize,
pub use_orthogonal_init: bool,
pub seed: Option<u64>,
}Expand description
Configuration for LstmBurnPolicy.
Mirrors crate::policy::mlp::MlpBurnConfig’s knobs that carry over
to a recurrent trunk. The LSTM has no depth knob (a single recurrent
layer for v1) and no activation knob (the gate/cell/hidden
activations are fixed by the LSTM cell equations).
Fields§
Width of the LSTM hidden/cell state (and therefore the feature vector fed to both heads).
use_orthogonal_init: boolIf true, use the PPO orthogonal recipe (gain sqrt(2) on the
gate weights, 0.01 on the output heads). If false, fall back
to Kaiming-uniform (seeded path) or Burn’s default XavierNormal
(unseeded path). Only affects the distribution the weights are
drawn from, never the reproducibility guarantee.
seed: Option<u64>Optional construction seed. When Some, with_config builds
every gate Linear and both heads from a deterministic,
StdRng-driven weight buffer instead of
Burn’s unseedable Initializer, so two constructions with the
same seed produce bit-identical policies. When None the
LSTM uses Burn’s default XavierNormal gate init (unseeded).
Implementations§
Source§impl LstmBurnConfig
impl LstmBurnConfig
Sourcepub fn with_seed(self, seed: u64) -> Self
pub fn with_seed(self, seed: u64) -> Self
Set the construction seed, enabling the deterministic host-side
init path in LstmBurnPolicy::with_config.
Builder-style; returns self for chaining:
LstmBurnConfig::default().with_seed(42).
Trait Implementations§
Source§impl Clone for LstmBurnConfig
impl Clone for LstmBurnConfig
Source§fn clone(&self) -> LstmBurnConfig
fn clone(&self) -> LstmBurnConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LstmBurnConfig
Source§impl Debug for LstmBurnConfig
impl Debug for LstmBurnConfig
Auto Trait Implementations§
impl Freeze for LstmBurnConfig
impl RefUnwindSafe for LstmBurnConfig
impl Send for LstmBurnConfig
impl Sync for LstmBurnConfig
impl Unpin for LstmBurnConfig
impl UnsafeUnpin for LstmBurnConfig
impl UnwindSafe for LstmBurnConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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