pub struct GradientProcessedOptimizer<T> { /* private fields */ }Expand description
Wrapper for optimizers that automatically applies gradient processing.
Implementations§
Source§impl<T> GradientProcessedOptimizer<T>
impl<T> GradientProcessedOptimizer<T>
Sourcepub fn new(base_optimizer: T, config: GradientProcessingConfig) -> Self
pub fn new(base_optimizer: T, config: GradientProcessingConfig) -> Self
Create a new gradient-processed optimizer.
Sourcepub fn with_default_processing(base_optimizer: T) -> Self
pub fn with_default_processing(base_optimizer: T) -> Self
Create with default gradient processing configuration.
Sourcepub fn gradient_processor(&self) -> &GradientProcessor
pub fn gradient_processor(&self) -> &GradientProcessor
Get reference to the gradient processor.
Sourcepub fn gradient_processor_mut(&mut self) -> &mut GradientProcessor
pub fn gradient_processor_mut(&mut self) -> &mut GradientProcessor
Get mutable reference to the gradient processor.
Sourcepub fn base_optimizer(&self) -> &T
pub fn base_optimizer(&self) -> &T
Get reference to the base optimizer.
Sourcepub fn base_optimizer_mut(&mut self) -> &mut T
pub fn base_optimizer_mut(&mut self) -> &mut T
Get mutable reference to the base optimizer.
Trait Implementations§
Source§impl<T: OptimizerState> OptimizerState for GradientProcessedOptimizer<T>
impl<T: OptimizerState> OptimizerState for GradientProcessedOptimizer<T>
Auto Trait Implementations§
impl<T> Freeze for GradientProcessedOptimizer<T>where
T: Freeze,
impl<T> RefUnwindSafe for GradientProcessedOptimizer<T>where
T: RefUnwindSafe,
impl<T> Send for GradientProcessedOptimizer<T>where
T: Send,
impl<T> Sync for GradientProcessedOptimizer<T>where
T: Sync,
impl<T> Unpin for GradientProcessedOptimizer<T>where
T: Unpin,
impl<T> UnwindSafe for GradientProcessedOptimizer<T>where
T: UnwindSafe,
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> 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>
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