pub struct MLPLeafModel { /* private fields */ }Available on crate feature
alloc only.Expand description
Single hidden layer MLP leaf model with ReLU activation.
Learns a nonlinear function via backpropagation with Newton-scaled
learning rate. Weights are lazily initialized on the first update call
using a deterministic xorshift64 PRNG so results are reproducible.
Optional exponential weight decay (decay) gives the model a finite memory
horizon for non-stationary streams.
Implementations§
Source§impl MLPLeafModel
impl MLPLeafModel
Sourcepub fn new(
hidden_size: usize,
learning_rate: f64,
seed: u64,
decay: Option<f64>,
) -> Self
pub fn new( hidden_size: usize, learning_rate: f64, seed: u64, decay: Option<f64>, ) -> Self
Create a new MLP leaf model with the given hidden layer size, learning rate, seed, and optional decay.
The seed controls deterministic weight initialization. Different seeds
produce different initial weights, which is critical for ensemble diversity
when multiple MLP leaves share the same hidden_size.
Trait Implementations§
Source§impl LeafModel for MLPLeafModel
impl LeafModel for MLPLeafModel
Auto Trait Implementations§
impl Freeze for MLPLeafModel
impl RefUnwindSafe for MLPLeafModel
impl Send for MLPLeafModel
impl Sync for MLPLeafModel
impl Unpin for MLPLeafModel
impl UnsafeUnpin for MLPLeafModel
impl UnwindSafe for MLPLeafModel
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