Struct Chain

Source
pub struct Chain<T, U>(pub T, pub U);

Tuple Fields§

§0: T§1: U

Trait Implementations§

Source§

impl<T, U, O> Backward for Chain<T, U>
where T: Backward<OutputDelta = U::InputDelta> + Forward<Output = O>, U: Backward + Forward<Input = O>,

Source§

type OutputDelta = <U as Backward>::OutputDelta

Source§

type InputDelta = <T as Backward>::InputDelta

Source§

type TrainDelta = (<T as Backward>::TrainDelta, <U as Backward>::TrainDelta)

Source§

fn backward( &self, input: &T::Input, internal: &Self::Internal, output_delta: &U::OutputDelta, ) -> (Self::InputDelta, Self::TrainDelta)

partials produces the change required in the input and trainable variables. Read more
Source§

fn backward_input( &self, input: &Self::Input, internal: &Self::Internal, output_delta: &Self::OutputDelta, ) -> Self::InputDelta

See Backward::backward for documentation.
Source§

fn backward_train( &self, input: &Self::Input, internal: &Self::Internal, output_delta: &Self::OutputDelta, ) -> Self::TrainDelta

See Backward::backward for documentation.
Source§

impl<T: Clone, U: Clone> Clone for Chain<T, U>

Source§

fn clone(&self) -> Chain<T, U>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, U: Debug> Debug for Chain<T, U>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T, U> Forward for Chain<T, U>
where T: Forward, U: Forward<Input = T::Output>,

Source§

type Input = <T as Forward>::Input

Source§

type Internal = (<T as Forward>::Internal, <T as Forward>::Output, <U as Forward>::Internal)

Source§

type Output = <U as Forward>::Output

Source§

fn forward(&self, input: &T::Input) -> (Self::Internal, Self::Output)

forward produces: Read more
Source§

fn run(&self, input: &Self::Input) -> Self::Output

run only produces the output from the input. The default implementation uses forward. You can make a custom implementation of this to avoid the overhead of producing and returning the internal variables.
Source§

impl<T, U, O> Train for Chain<T, U>
where T: Train + Backward<OutputDelta = U::InputDelta> + Forward<Output = O>, U: Train + Backward + Forward<Input = O>,

Source§

fn train(&mut self, train_delta: &Self::TrainDelta)

train takes in a train delta Δv and applies it to the trained variables. Read more
Source§

fn propogate( &mut self, input: &Self::Input, internal: &Self::Internal, output_delta: &Self::OutputDelta, ) -> Self::InputDelta

propogate should have the same effect as running backwards followed by train. Read more

Auto Trait Implementations§

§

impl<T, U> Freeze for Chain<T, U>
where T: Freeze, U: Freeze,

§

impl<T, U> RefUnwindSafe for Chain<T, U>

§

impl<T, U> Send for Chain<T, U>
where T: Send, U: Send,

§

impl<T, U> Sync for Chain<T, U>
where T: Sync, U: Sync,

§

impl<T, U> Unpin for Chain<T, U>
where T: Unpin, U: Unpin,

§

impl<T, U> UnwindSafe for Chain<T, U>
where T: UnwindSafe, U: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Graph for T
where T: Train,

Source§

fn chain<U>(self, other: U) -> Chain<Self, U>

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.