pub struct Chain<A, C>(pub A, pub C);Expand description
Two transformations applied one after the other (optax.chain).
Tuple Fields§
§0: A§1: CTrait Implementations§
Source§impl<A: GradientTransformation, C: GradientTransformation> GradientTransformation for Chain<A, C>
impl<A: GradientTransformation, C: GradientTransformation> GradientTransformation for Chain<A, C>
Source§type State<B: Backend, T: Float> = (<A as GradientTransformation>::State<B, T>, <C as GradientTransformation>::State<B, T>)
type State<B: Backend, T: Float> = (<A as GradientTransformation>::State<B, T>, <C as GradientTransformation>::State<B, T>)
The state, for leaves of type
T on backend B.Source§fn init<B: Backend, T: Float>(
&self,
params: &[Array<B, T>],
) -> Self::State<B, T>
fn init<B: Backend, T: Float>( &self, params: &[Array<B, T>], ) -> Self::State<B, T>
The initial state for parameters with the leaves
params.Source§fn update<B: Backend, T: Float>(
&self,
updates: Vec<Array<B, T>>,
(s0, s1): Self::State<B, T>,
) -> (Vec<Array<B, T>>, Self::State<B, T>)
fn update<B: Backend, T: Float>( &self, updates: Vec<Array<B, T>>, (s0, s1): Self::State<B, T>, ) -> (Vec<Array<B, T>>, Self::State<B, T>)
Transforms the updates (one per leaf of the parameters) and returns
the new state.
Auto Trait Implementations§
impl<A, C> Freeze for Chain<A, C>
impl<A, C> RefUnwindSafe for Chain<A, C>where
A: RefUnwindSafe,
C: RefUnwindSafe,
impl<A, C> Send for Chain<A, C>
impl<A, C> Sync for Chain<A, C>
impl<A, C> Unpin for Chain<A, C>
impl<A, C> UnsafeUnpin for Chain<A, C>where
A: UnsafeUnpin,
C: UnsafeUnpin,
impl<A, C> UnwindSafe for Chain<A, C>where
A: UnwindSafe,
C: 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