pub struct ScaleByAdam {
pub b1: f64,
pub b2: f64,
pub eps: f64,
pub eps_root: f64,
}Expand description
Adam’s rescaling of the updates (optax.scale_by_adam).
Fields§
§b1: f64The decay of the first moments.
b2: f64The decay of the second moments.
eps: f64Added to the denominator.
eps_root: f64Added to the second moments inside the square root.
Trait Implementations§
Source§impl Clone for ScaleByAdam
impl Clone for ScaleByAdam
impl Copy for ScaleByAdam
Source§impl Debug for ScaleByAdam
impl Debug for ScaleByAdam
Source§impl Default for ScaleByAdam
impl Default for ScaleByAdam
Source§impl GradientTransformation for ScaleByAdam
impl GradientTransformation for ScaleByAdam
Source§type State<B: Backend, T: Float> = AdamState<B, T>
type State<B: Backend, T: Float> = AdamState<B, T>
The state, for leaves of type
T on backend B.Source§fn init<B: Backend, T: Float>(&self, params: &[Array<B, T>]) -> AdamState<B, T>
fn init<B: Backend, T: Float>(&self, params: &[Array<B, T>]) -> AdamState<B, T>
The initial state for parameters with the leaves
params.Source§fn update<B: Backend, T: Float>(
&self,
updates: Vec<Array<B, T>>,
state: AdamState<B, T>,
) -> (Vec<Array<B, T>>, AdamState<B, T>)
fn update<B: Backend, T: Float>( &self, updates: Vec<Array<B, T>>, state: AdamState<B, T>, ) -> (Vec<Array<B, T>>, AdamState<B, T>)
Transforms the updates (one per leaf of the parameters) and returns
the new state.
Auto Trait Implementations§
impl Freeze for ScaleByAdam
impl RefUnwindSafe for ScaleByAdam
impl Send for ScaleByAdam
impl Sync for ScaleByAdam
impl Unpin for ScaleByAdam
impl UnsafeUnpin for ScaleByAdam
impl UnwindSafe for ScaleByAdam
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