1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
//! A layer of a neural network.

use crate::array::*;

/// A layer of a neural network, which implements a forward, and backward pass.
pub trait Layer {
    /// Computes the forward pass of the layer.
    fn forward(&self, x: Array) -> Array;

    /// Retrieves the parameters of the layer.
    fn parameters(&mut self) -> Vec<&mut Array>;
}