Skip to content

Commit

Permalink
feat/container: put sequential layer into container dir
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the Sequential and SequentialConfig struct is no longer
available via leaf::layers::common::
  • Loading branch information
MichaelHirn committed Mar 31, 2016
1 parent f648454 commit bb23b76
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/layers/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pub use self::linear::{Linear, LinearConfig};
pub use self::log_softmax::LogSoftmax;
#[cfg(all(feature="cuda", not(feature="native")))]
pub use self::pooling::{Pooling, PoolingConfig, PoolingMode};
pub use self::sequential::{Sequential, SequentialConfig};
pub use self::softmax::Softmax;

#[cfg(all(feature="cuda", not(feature="native")))]
Expand All @@ -25,7 +24,6 @@ pub mod linear;
pub mod log_softmax;
#[cfg(all(feature="cuda", not(feature="native")))]
pub mod pooling;
pub mod sequential;
pub mod softmax;

/// Provides common utilities for Layers that utilize a filter with stride and padding.
Expand Down
15 changes: 15 additions & 0 deletions src/layers/container/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//! Provides container layers.
//!
//! For now layers in container should be discribed as layers that are used
//! to connect multiple layers together to create 'networks'.
#[macro_export]
macro_rules! impl_ilayer_common {
() => (
fn exact_num_output_blobs(&self) -> Option<usize> { Some(1) }
fn exact_num_input_blobs(&self) -> Option<usize> { Some(1) }
)
}

pub use self::sequential::{Sequential, SequentialConfig};

pub mod sequential;
File renamed without changes.
16 changes: 13 additions & 3 deletions src/layers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
//!
//! These layers provide different type of operations to the data Blobs
//! that flow through them.
//! The operations provided by the layers can be
//! roughly grouped into four categories:
//! The operations provided by the layers are grouped into five categories:
//!
//! * [__Activation__][mod_activation]</br>
//! Activation Layers provide element-wise operations and produce one top Blob
Expand Down Expand Up @@ -31,6 +30,12 @@
//! Utility Layers follow the general behavior of a layer, like the other types
//! do.
//!
//! * [__Container__][mod_container]</br>
//! Container layers take `LayerConfig`s and connect them on initialization, which
//! creates a "network". But as container layers are layers one can stack multiple
//! container layers on top of another and compose even bigger container layers.
//! Container layers differ in how they connect the layers that it receives.
//!
//! For more information about how these layers work together, see the
//! documentation for the general [Layer module][3].
//!
Expand All @@ -41,6 +46,7 @@
//! [mod_common]: ./common/index.html
//! [mod_loss]: ./loss/index.html
//! [mod_utility]: ./utility/index.html
//! [mod_container]: ./container/index.html

/// Implement [ILayer][1] for [activation layers][2].
/// [1]: ./layer/trait.ILayer.html
Expand All @@ -60,7 +66,6 @@ pub use self::common::{
pub use self::common::{
Linear, LinearConfig,
LogSoftmax,
Sequential, SequentialConfig,
Softmax,
};

Expand All @@ -73,7 +78,12 @@ pub use self::utility::{
Reshape, ReshapeConfig,
};

pub use self::container::{
Sequential, SequentialConfig,
};

pub mod activation;
pub mod common;
pub mod loss;
pub mod utility;
pub mod container;

0 comments on commit bb23b76

Please sign in to comment.