concision_core/models/model_params.rs
1/*
2 Appellation: store <module>
3 Contrib: @FL03
4*/
5
6use concision_params::ParamsBase;
7use ndarray::{Dimension, RawData};
8
9use crate::RawHidden;
10
11pub struct DeepNeuralNetworkStore<X, Y, Z> {
12 pub input: X,
13 pub hidden: Y,
14 pub output: Z,
15}
16
17/// The [`ModelParamsBase`] object is a generic container for storing the parameters of a
18/// neural network, regardless of the layout (e.g. shallow or deep). This is made possible
19/// through the introduction of a generic hidden layer type, `H`, that allows us to define
20/// aliases and additional traits for contraining the hidden layer type. Additionally, the
21/// structure enables the introduction of common accessors and initialization routines.
22///
23/// With that in mind, we don't reccomend using the implementation directly, rather, leverage
24/// a type alias that best suites your use case (e.g. owned parameters, arc parameters, etc.).
25pub struct ModelParamsBase<S, D, H, A = <S as RawData>::Elem>
26where
27 D: Dimension,
28 S: RawData<Elem = A>,
29 H: RawHidden<S, D>,
30{
31 /// the input layer of the model
32 pub(crate) input: ParamsBase<S, D, A>,
33 /// a sequential stack of params for the model's hidden layers
34 pub(crate) hidden: H,
35 /// the output layer of the model
36 pub(crate) output: ParamsBase<S, D, A>,
37}