pub struct ScaleBySchedule<S>(pub S);Expand description
Multiplies the updates by minus the learning rate of the schedule
(optax.scale_by_learning_rate with a schedule).
Tuple Fields§
§0: STrait Implementations§
Source§impl<S: Clone> Clone for ScaleBySchedule<S>
impl<S: Clone> Clone for ScaleBySchedule<S>
Source§impl<S: Debug> Debug for ScaleBySchedule<S>
impl<S: Debug> Debug for ScaleBySchedule<S>
Source§impl<S: Schedule> GradientTransformation for ScaleBySchedule<S>
impl<S: Schedule> GradientTransformation for ScaleBySchedule<S>
Source§type State<B: Backend, T: Float> = Scalar<B, i32>
type State<B: Backend, T: Float> = Scalar<B, i32>
The state, for leaves of type
T on backend B.Source§fn init<B: Backend, T: Float>(&self, _: &[Array<B, T>]) -> I32<B>
fn init<B: Backend, T: Float>(&self, _: &[Array<B, T>]) -> I32<B>
The initial state for parameters with the leaves
params.Source§fn update<B: Backend, T: Float>(
&self,
updates: Vec<Array<B, T>>,
count: I32<B>,
) -> (Vec<Array<B, T>>, I32<B>)
fn update<B: Backend, T: Float>( &self, updates: Vec<Array<B, T>>, count: I32<B>, ) -> (Vec<Array<B, T>>, I32<B>)
Transforms the updates (one per leaf of the parameters) and returns
the new state.
Auto Trait Implementations§
impl<S> Freeze for ScaleBySchedule<S>where
S: Freeze,
impl<S> RefUnwindSafe for ScaleBySchedule<S>where
S: RefUnwindSafe,
impl<S> Send for ScaleBySchedule<S>where
S: Send,
impl<S> Sync for ScaleBySchedule<S>where
S: Sync,
impl<S> Unpin for ScaleBySchedule<S>where
S: Unpin,
impl<S> UnsafeUnpin for ScaleBySchedule<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for ScaleBySchedule<S>where
S: 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