pub struct Lookahead<O> { /* private fields */ }Expand description
Lookahead optimizer wrapper.
Maintains “slow weights” that are periodically interpolated toward the fast
weights produced by the inner optimizer. Every k calls to step, the
slow weights are updated via:
slow_w = slow_w + alpha * (fast_w - slow_w)
fast_w = slow_wImplementations§
Trait Implementations§
Auto Trait Implementations§
impl<O> Freeze for Lookahead<O>where
O: Freeze,
impl<O> RefUnwindSafe for Lookahead<O>where
O: RefUnwindSafe,
impl<O> Send for Lookahead<O>where
O: Send,
impl<O> Sync for Lookahead<O>where
O: Sync,
impl<O> Unpin for Lookahead<O>where
O: Unpin,
impl<O> UnsafeUnpin for Lookahead<O>where
O: UnsafeUnpin,
impl<O> UnwindSafe for Lookahead<O>where
O: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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