1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//! Neural network layers: the layer subsystem aggregator
//!
//! Declares every layer submodule and glob-re-exports the public layer types. It also defines
//! the shared infrastructure used across the subsystem: the
//! [`TrainingParameters`](crate::neural_network::layers::TrainingParameters) classification (a
//! layer is `Trainable`, `NonTrainable`, or `NoTrainable`), and the
//! `no_trainable_parameters_layer_functions` macro. That macro emits the `param_count` and
//! `get_weights` stubs for parameter-free layers.
//!
//! The submodules fall into a few categories:
//!
//! - Core layers (re-exported): [`activation`](crate::neural_network::layers::activation),
//! [`convolution`](crate::neural_network::layers::convolution),
//! [`dense`](crate::neural_network::layers::dense),
//! [`flatten`](crate::neural_network::layers::flatten),
//! [`pooling`](crate::neural_network::layers::pooling),
//! [`recurrent`](crate::neural_network::layers::recurrent), and
//! [`regularization`](crate::neural_network::layers::regularization)
//! - Weight containers: [`layer_weight`](crate::neural_network::layers::layer_weight)
//! - Shared (private) helpers: `conv_op_helpers` (2D/4D convolution zero-padding) and
//! `shape_helpers` (pooling/convolution output-shape calculators)
//! - Validation: `validation` (shared input/weight checks)
//! - Serialization: [`serialize_model`](crate::neural_network::layers::serialize_model)
//! (model-level snapshot and load-time weight application)
/// Classifies a layer by its parameter training capability
///
/// Layers fall into 3 groups. Some have trainable parameters, such as Dense or a convolutional
/// layer. Some have parameters, but they are frozen. Others have no parameters at all, such as
/// a pooling or activation layer
/// A module containing activation layer implementations for neural networks
/// Convolution-internal helpers (output assembly, gradient accumulation, padding)
/// Convolutional layer for neural networks
/// Dense (Fully Connected) layer implementation for neural networks
/// A layer that flattens a 3D, 4D, or 5D tensor into a 2D tensor
/// Container for different types of neural network layer weights
/// Pooling layer for neural networks
/// Recurrent layer for neural networks
/// A module containing regularization layers for neural networks
/// Model-level serialization scaffolding (whole-model snapshot and load-time weight application)
/// Output-shape calculators for pooling and convolution layers
/// Shared input/weight validation for the layer module
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
/// Generates the trait method stubs for layers without trainable parameters
///
/// Such layers rely on the default [`Layer::parameters`] (an empty list, so the optimizer
/// skips them). This macro supplies the remaining required `param_count` and `get_weights`
/// methods
///
/// It is path-exported via a `pub(in ...) use` re-export, so callers import it explicitly
/// rather than depending on textual macro ordering:
/// `use crate::neural_network::layers::no_trainable_parameters_layer_functions;`
///
/// The generated `param_count` returns `TrainingParameters::NoTrainable`, and `get_weights`
/// returns `LayerWeight::Empty`
pub use no_trainable_parameters_layer_functions;