concision_core/params/
mod.rs

1/*
2    Appellation: params <module>
3    Contrib: @FL03
4*/
5//! Parameters for constructing neural network models. This module implements parameters using
6//! the [ParamsBase] struct and its associated types. The [ParamsBase] struct provides:
7//!
8//! - An (n) dimensional weight tensor as [ArrayBase](ndarray::ArrayBase)
9//! - An (n-1) dimensional bias tensor as [ArrayBase](ndarray::ArrayBase)
10//!
11//! The associated types follow suite with the [`ndarray`] crate, each of which defines a
12//! different style of representation for the parameters.
13#[doc(inline)]
14pub use self::{error::ParamsError, params::ParamsBase};
15
16pub mod error;
17pub mod iter;
18pub mod params;
19
20mod impls {
21    pub mod impl_init;
22    pub mod impl_ops;
23}
24
25pub(crate) mod prelude {
26    pub use super::error::ParamsError;
27    pub use super::params::ParamsBase;
28    pub use super::{Params, ParamsView, ParamsViewMut};
29}
30
31/// a type alias for owned parameters
32pub type Params<A, D = ndarray::Ix2> = ParamsBase<ndarray::OwnedRepr<A>, D>;
33/// a type alias for shared parameters
34pub type ArcParams<A, D = ndarray::Ix2> = ParamsBase<ndarray::OwnedArcRepr<A>, D>;
35/// a type alias for an immutable view of the parameters
36pub type ParamsView<'a, A, D = ndarray::Ix2> = ParamsBase<ndarray::ViewRepr<&'a A>, D>;
37/// a type alias for a mutable view of the parameters
38pub type ParamsViewMut<'a, A, D = ndarray::Ix2> = ParamsBase<ndarray::ViewRepr<&'a mut A>, D>;
39/// a type alias for borrowed parameters
40pub type CowParams<'a, A, D = ndarray::Ix2> = ParamsBase<ndarray::CowRepr<'a, A>, D>;
41/// a raw view of the parameters; internally uses a constant pointer
42pub type RawViewParams<A, D = ndarray::Ix2> = ParamsBase<ndarray::RawViewRepr<*const A>, D>;
43/// a mutable raw view of the parameters; internally uses a mutable pointer
44pub type RawMutParams<A, D = ndarray::Ix2> = ParamsBase<ndarray::RawViewRepr<*mut A>, D>;