pub struct NaturalGradient { /* private fields */ }Expand description
Natural gradient optimizer
Implementations§
Source§impl NaturalGradient
impl NaturalGradient
Sourcepub fn new(config: NaturalGradientConfig) -> Self
pub fn new(config: NaturalGradientConfig) -> Self
Create new natural gradient optimizer
Sourcepub fn step_logits(&self, logits: &[f32], grad_logits: &[f32]) -> Vec<f32>
pub fn step_logits(&self, logits: &[f32], grad_logits: &[f32]) -> Vec<f32>
Compute natural gradient step for logits Returns updated logits
Trait Implementations§
Source§impl Clone for NaturalGradient
impl Clone for NaturalGradient
Source§fn clone(&self) -> NaturalGradient
fn clone(&self) -> NaturalGradient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NaturalGradient
impl RefUnwindSafe for NaturalGradient
impl Send for NaturalGradient
impl Sync for NaturalGradient
impl Unpin for NaturalGradient
impl UnwindSafe for NaturalGradient
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