pub struct Scale(pub f64);Expand description
Multiplies the updates by a constant (optax.scale).
Tuple Fields§
§0: f64Trait Implementations§
impl Copy for Scale
Source§impl GradientTransformation for Scale
impl GradientTransformation for Scale
Source§fn init<B: Backend, T: Float>(&self, _: &[Array<B, T>])
fn init<B: Backend, T: Float>(&self, _: &[Array<B, T>])
The initial state for parameters with the leaves
params.Source§fn update<B: Backend, T: Float>(
&self,
updates: Vec<Array<B, T>>,
(): (),
) -> (Vec<Array<B, T>>, ())
fn update<B: Backend, T: Float>( &self, updates: Vec<Array<B, T>>, (): (), ) -> (Vec<Array<B, T>>, ())
Transforms the updates (one per leaf of the parameters) and returns
the new state.
Auto Trait Implementations§
impl Freeze for Scale
impl RefUnwindSafe for Scale
impl Send for Scale
impl Sync for Scale
impl Unpin for Scale
impl UnsafeUnpin for Scale
impl UnwindSafe for Scale
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