[−][src]Trait mli::Backward
This trait indicates support of backwards propogation.
This trait also contains methods to perform training if training is possible. If training is not possible, this trait can still be implemented with those definitions being empty. In that case, machine learning algorithms will still be able to back propogate over this operation, but training it will be a no-op.
Associated Types
Loading content...Required methods
fn backward(
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> (Self::InputDelta, Self::TrainDelta)
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> (Self::InputDelta, Self::TrainDelta)
partials
produces the change required in the input and trainable variables.
Key:
f
is the outputx
is the inputv
is the trainable variablesE
is the loss or errordelta
is equivalent toΔf
or-η * 𝛿E/𝛿f
This method should produce (Δx, Δv)
:
Δx = Δf * 𝛿f/𝛿x
Δv = Δf * 𝛿f/𝛿v
𝛿f/𝛿x
and 𝛿f/𝛿v
can be an approximation, particularly if the function is not differentiable
(e.g. ReLU and signum).
Provided methods
fn backward_input(
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> Self::InputDelta
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> Self::InputDelta
See Backward::backward
for documentation.
fn backward_train(
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> Self::TrainDelta
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> Self::TrainDelta
See Backward::backward
for documentation.
Implementors
impl<'a, T> Backward for &'a T where
T: Backward,
[src]
T: Backward,
type OutputDelta = T::OutputDelta
type InputDelta = T::InputDelta
type TrainDelta = T::TrainDelta
fn backward(
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> (Self::InputDelta, Self::TrainDelta)
[src]
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> (Self::InputDelta, Self::TrainDelta)
fn backward_input(
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> Self::InputDelta
[src]
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> Self::InputDelta
fn backward_train(
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> Self::TrainDelta
[src]
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> Self::TrainDelta
impl<'a, T> Backward for &'a mut T where
T: Backward,
[src]
T: Backward,
type OutputDelta = T::OutputDelta
type InputDelta = T::InputDelta
type TrainDelta = T::TrainDelta
fn backward(
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> (Self::InputDelta, Self::TrainDelta)
[src]
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> (Self::InputDelta, Self::TrainDelta)
fn backward_input(
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> Self::InputDelta
[src]
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> Self::InputDelta
fn backward_train(
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> Self::TrainDelta
[src]
&self,
input: &Self::Input,
internal: &Self::Internal,
output_delta: &Self::OutputDelta
) -> Self::TrainDelta
impl<T, U, O> Backward for Chain<T, U> where
T: Backward<OutputDelta = U::InputDelta> + Forward<Output = O>,
U: Backward + Forward<Input = O>,
[src]
T: Backward<OutputDelta = U::InputDelta> + Forward<Output = O>,
U: Backward + Forward<Input = O>,
type OutputDelta = U::OutputDelta
type InputDelta = T::InputDelta
type TrainDelta = (T::TrainDelta, U::TrainDelta)
fn backward(
&self,
input: &T::Input,
internal: &Self::Internal,
output_delta: &U::OutputDelta
) -> (Self::InputDelta, Self::TrainDelta)
[src]
&self,
input: &T::Input,
internal: &Self::Internal,
output_delta: &U::OutputDelta
) -> (Self::InputDelta, Self::TrainDelta)