Skip to content

Commit bb23b76

Browse files
author
MichaelHirn
committed
feat/container: put sequential layer into container dir
BREAKING CHANGE: the Sequential and SequentialConfig struct is no longer available via leaf::layers::common::
1 parent f648454 commit bb23b76

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

src/layers/common/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub use self::linear::{Linear, LinearConfig};
1616
pub use self::log_softmax::LogSoftmax;
1717
#[cfg(all(feature="cuda", not(feature="native")))]
1818
pub use self::pooling::{Pooling, PoolingConfig, PoolingMode};
19-
pub use self::sequential::{Sequential, SequentialConfig};
2019
pub use self::softmax::Softmax;
2120

2221
#[cfg(all(feature="cuda", not(feature="native")))]
@@ -25,7 +24,6 @@ pub mod linear;
2524
pub mod log_softmax;
2625
#[cfg(all(feature="cuda", not(feature="native")))]
2726
pub mod pooling;
28-
pub mod sequential;
2927
pub mod softmax;
3028

3129
/// Provides common utilities for Layers that utilize a filter with stride and padding.

src/layers/container/mod.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//! Provides container layers.
2+
//!
3+
//! For now layers in container should be discribed as layers that are used
4+
//! to connect multiple layers together to create 'networks'.
5+
#[macro_export]
6+
macro_rules! impl_ilayer_common {
7+
() => (
8+
fn exact_num_output_blobs(&self) -> Option<usize> { Some(1) }
9+
fn exact_num_input_blobs(&self) -> Option<usize> { Some(1) }
10+
)
11+
}
12+
13+
pub use self::sequential::{Sequential, SequentialConfig};
14+
15+
pub mod sequential;
File renamed without changes.

src/layers/mod.rs

+13-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
//!
33
//! These layers provide different type of operations to the data Blobs
44
//! that flow through them.
5-
//! The operations provided by the layers can be
6-
//! roughly grouped into four categories:
5+
//! The operations provided by the layers are grouped into five categories:
76
//!
87
//! * [__Activation__][mod_activation]</br>
98
//! Activation Layers provide element-wise operations and produce one top Blob
@@ -31,6 +30,12 @@
3130
//! Utility Layers follow the general behavior of a layer, like the other types
3231
//! do.
3332
//!
33+
//! * [__Container__][mod_container]</br>
34+
//! Container layers take `LayerConfig`s and connect them on initialization, which
35+
//! creates a "network". But as container layers are layers one can stack multiple
36+
//! container layers on top of another and compose even bigger container layers.
37+
//! Container layers differ in how they connect the layers that it receives.
38+
//!
3439
//! For more information about how these layers work together, see the
3540
//! documentation for the general [Layer module][3].
3641
//!
@@ -41,6 +46,7 @@
4146
//! [mod_common]: ./common/index.html
4247
//! [mod_loss]: ./loss/index.html
4348
//! [mod_utility]: ./utility/index.html
49+
//! [mod_container]: ./container/index.html
4450
4551
/// Implement [ILayer][1] for [activation layers][2].
4652
/// [1]: ./layer/trait.ILayer.html
@@ -60,7 +66,6 @@ pub use self::common::{
6066
pub use self::common::{
6167
Linear, LinearConfig,
6268
LogSoftmax,
63-
Sequential, SequentialConfig,
6469
Softmax,
6570
};
6671

@@ -73,7 +78,12 @@ pub use self::utility::{
7378
Reshape, ReshapeConfig,
7479
};
7580

81+
pub use self::container::{
82+
Sequential, SequentialConfig,
83+
};
84+
7685
pub mod activation;
7786
pub mod common;
7887
pub mod loss;
7988
pub mod utility;
89+
pub mod container;

0 commit comments

Comments
 (0)