concision_core/traits/propagation.rs
1/*
2    Appellation: predict <module>
3    Contrib: @FL03
4*/
5
6/// A simple trait denoting a single backward pass through a layer of a neural network; the
7/// trait
8pub trait Backward<X, Y> {
9    type HParam;
10    type Output;
11
12    fn backward(
13        &mut self,
14        input: &X,
15        delta: &Y,
16        gamma: Self::HParam,
17    ) -> crate::Result<Self::Output>;
18}
19
20/// This trait defines the forward pass of the network
21
22pub trait Forward<Rhs> {
23    type Output;
24
25    fn forward(&self, input: &Rhs) -> crate::Result<Self::Output>;
26}