pub struct SophiaOptimizer { /* private fields */ }Expand description
Sophia optimizer - Second-order optimizer with Hessian diagonal estimation
Maintains three state tensors per parameter:
- m: First moment estimate (exponential moving average of gradients)
- h: Hessian diagonal estimate (EMA of element-wise gradient^2 or Hutchinson estimate)
- t: Step counter for bias correction
Implementations§
Source§impl SophiaOptimizer
impl SophiaOptimizer
Sourcepub fn new(config: OptimizerConfig) -> Self
pub fn new(config: OptimizerConfig) -> Self
Create a new Sophia optimizer with default Sophia configuration
Sourcepub fn with_sophia_config(config: SophiaConfig) -> Self
pub fn with_sophia_config(config: SophiaConfig) -> Self
Create a new Sophia optimizer with custom Sophia configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SophiaOptimizer
impl RefUnwindSafe for SophiaOptimizer
impl Send for SophiaOptimizer
impl Sync for SophiaOptimizer
impl Unpin for SophiaOptimizer
impl UnwindSafe for SophiaOptimizer
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> 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