concision_neural/
lib.rs

1/*
2    Appellation: concision-neural <library>
3    Contrib: @FL03
4*/
5//! # concision-neural
6//!
7//! This crate focuses on implementing various neural network components, including models,
8//! layers, and training mechanisms.
9//!
10//! ## Overview
11//!
12//! Neural networks are a fundamental part of machine learning, and this crate provides a
13//! comprehensive set of tools to build, configure, and train neural network models. Listed
14//! below are several key components of the crate:
15//!
16//! - [`Model`]: A trait for defining a neural network model.
17//! - [`ModelParamsBase`]: A dedicated object capable of storing the parameters for both
18//!   shallow and deep neural networks.
19//! - [`StandardModelConfig`]: A standard configuration for the models
20//!
21//! ### Traits
22//!
23//! This crate extends the [`Forward`](cnc::Forward) and [`Backward`](cnc::Backward) traits
24//! from the [`core`](cnc) crate to provide additional functionality for neural networks.
25//!
26//! - [`Predict`]: A more robust implementation of the [`Forward`] trait
27//! - [`Train`]: A trait for training a neural network model.
28//!
29#![cfg_attr(not(feature = "std"), no_std)]
30#![allow(
31    clippy::missing_saftey_doc,
32    clippy::module_inception,
33    clippy::needless_doctest_main,
34    clippy::upper_case_acronyms
35)]
36// ensure that either `std` or `alloc` feature is enabled
37#[cfg(not(any(feature = "std", feature = "alloc")))]
38compile_error! {
39    "At least one of the 'std' or 'alloc' features must be enabled."
40}
41
42extern crate concision_core as cnc;
43
44#[cfg(feature = "alloc")]
45extern crate alloc;
46
47#[doc(inline)]
48pub use self::{
49    config::prelude::*,
50    error::*,
51    layers::{Layer, LayerBase},
52    model::prelude::*,
53    traits::*,
54    types::*,
55};
56
57#[macro_use]
58pub(crate) mod macros {
59    #[macro_use]
60    pub mod config;
61    #[macro_use]
62    pub mod seal;
63}
64
65pub mod config;
66pub mod error;
67pub mod layers;
68pub mod model;
69
70pub(crate) mod traits {
71    #[doc(inline)]
72    pub use self::prelude::*;
73
74    pub(crate) mod hidden;
75    pub(crate) mod predict;
76    pub(crate) mod train;
77
78    mod prelude {
79        #[doc(inline)]
80        pub use super::hidden::*;
81        #[doc(inline)]
82        pub use super::predict::*;
83        #[doc(inline)]
84        pub use super::train::*;
85    }
86}
87
88pub(crate) mod types {
89    #[doc(inline)]
90    pub use self::prelude::*;
91
92    mod dropout;
93    mod key_value;
94
95    mod prelude {
96        #[doc(inline)]
97        pub use super::dropout::*;
98        #[doc(inline)]
99        pub use super::key_value::*;
100    }
101}
102
103#[doc(hidden)]
104pub mod prelude {
105    #[doc(no_inline)]
106    pub use super::config::prelude::*;
107    #[doc(hidden)]
108    pub use crate::layers::prelude::*;
109    #[doc(no_inline)]
110    pub use crate::model::prelude::*;
111    #[doc(no_inline)]
112    pub use crate::traits::*;
113    #[doc(no_inline)]
114    pub use crate::types::*;
115}