pub struct MlpBurnConfig {
pub num_layers: usize,
pub hidden_dim: usize,
pub use_orthogonal_init: bool,
pub activation: BurnActivation,
pub seed: Option<u64>,
}Expand description
Configuration for MlpBurnPolicy architecture.
Mirrors crate::policy::mlp::MlpBurnConfig on the tch path. Stored
inside the policy so the parity tests can compare both backends on
identical hyperparameters.
Fields§
§num_layers: usizeNumber of hidden layers in the shared trunk. Only 2 or 3 are
supported; anything else is treated as 2.
Width of every hidden layer.
use_orthogonal_init: boolIf true, initialize hidden-layer weights with
Initializer::Orthogonal (gain sqrt(2)) and output heads
with Initializer::Orthogonal { gain = 0.01 }. Set false to
fall back to Burn’s default Kaiming-uniform init.
activation: BurnActivationActivation applied between hidden layers.
seed: Option<u64>Optional construction seed. When Some, with_config builds
every layer from a deterministic, StdRng-
driven weight buffer (see crate::policy::seeded_init) instead
of Burn’s unseedable Initializer, so two constructions with
the same seed produce bit-identical policies. When None
(the default) the behavior is unchanged — Burn’s Initializer
path is used verbatim. This is the load-bearing knob behind the
end-to-end PsroConfig::seed / NfspConfig::seed reproducibility
contract (issue #135). The seeded path covers both the
orthogonal and Kaiming-uniform recipes (selected by
use_orthogonal_init), so seeding works regardless of which init
the caller picks.
Implementations§
Trait Implementations§
Source§impl Clone for MlpBurnConfig
impl Clone for MlpBurnConfig
Source§fn clone(&self) -> MlpBurnConfig
fn clone(&self) -> MlpBurnConfig
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 MlpBurnConfig
Source§impl Debug for MlpBurnConfig
impl Debug for MlpBurnConfig
Auto Trait Implementations§
impl Freeze for MlpBurnConfig
impl RefUnwindSafe for MlpBurnConfig
impl Send for MlpBurnConfig
impl Sync for MlpBurnConfig
impl Unpin for MlpBurnConfig
impl UnsafeUnpin for MlpBurnConfig
impl UnwindSafe for MlpBurnConfig
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