mlpack  3.0.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Sequential< InputDataType, OutputDataType, CustomLayers > Class Template Reference

Implementation of the Sequential class. More...

Public Member Functions

 Sequential (const bool model=true)
 Create the Sequential object using the specified parameters. More...
 
 ~Sequential ()
 Destroy the Sequential object. More...
 
template<class LayerType , class... Args>
void Add (Args...args)
 
void Add (LayerTypes< CustomLayers...> layer)
 
template<typename eT >
void Backward (const arma::Mat< eT > &&, arma::Mat< eT > &&gy, arma::Mat< eT > &&g)
 Ordinary feed backward pass of a neural network, using 3rd-order tensors as input, calculating the function f(x) by propagating x backwards through f. More...
 
arma::mat const & Delta () const
 Get the delta.e. More...
 
arma::mat & Delta ()
 Modify the delta. More...
 
template<typename eT >
void Forward (arma::Mat< eT > &&input, arma::Mat< eT > &&output)
 Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activity forward through f. More...
 
template<typename eT >
void Gradient (arma::Mat< eT > &&input, arma::Mat< eT > &&error, arma::Mat< eT > &&)
 
arma::mat const & Gradient () const
 Get the gradient. More...
 
arma::mat & Gradient ()
 Modify the gradient. More...
 
arma::mat const & InputParameter () const
 
arma::mat & InputParameter ()
 Modify the input parameter. More...
 
std::vector< LayerTypes
< CustomLayers...> > & 
Model ()
 Return the model modules. More...
 
arma::mat const & OutputParameter () const
 Get the output parameter. More...
 
arma::mat & OutputParameter ()
 Modify the output parameter. More...
 
const arma::mat & Parameters () const
 Return the initial point for the optimization. More...
 
arma::mat & Parameters ()
 Modify the initial point for the optimization. More...
 
template<typename Archive >
void serialize (Archive &, const unsigned int)
 Serialize the layer. More...
 

Detailed Description

template<typename InputDataType, typename OutputDataType, typename... CustomLayers>
class mlpack::ann::Sequential< InputDataType, OutputDataType, CustomLayers >

Implementation of the Sequential class.

The sequential class works as a feed-forward fully connected network container which plugs various layers together.

Template Parameters
InputDataTypeType of the input data (arma::colvec, arma::mat, arma::sp_mat or arma::cube).
OutputDataTypeType of the output data (arma::colvec, arma::mat, arma::sp_mat or arma::cube).

Definition at line 70 of file layer_types.hpp.

Constructor & Destructor Documentation

Sequential ( const bool  model = true)

Create the Sequential object using the specified parameters.

Parameters
modelExpose the all network modules.
~Sequential ( )

Destroy the Sequential object.

Member Function Documentation

void Add ( Args...  args)
inline

Definition at line 102 of file sequential.hpp.

void Add ( LayerTypes< CustomLayers...>  layer)
inline

Definition at line 109 of file sequential.hpp.

void Backward ( const arma::Mat< eT > &&  ,
arma::Mat< eT > &&  gy,
arma::Mat< eT > &&  g 
)

Ordinary feed backward pass of a neural network, using 3rd-order tensors as input, calculating the function f(x) by propagating x backwards through f.

Using the results from the feed forward pass.

Parameters
inputThe propagated input activation.
gyThe backpropagated error.
gThe calculated gradient.
arma::mat const& Delta ( ) const
inline

Get the delta.e.

Definition at line 137 of file sequential.hpp.

arma::mat& Delta ( )
inline

Modify the delta.

Definition at line 139 of file sequential.hpp.

void Forward ( arma::Mat< eT > &&  input,
arma::Mat< eT > &&  output 
)

Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activity forward through f.

Parameters
inputInput data used for evaluating the specified function.
outputResulting output activation.
void Gradient ( arma::Mat< eT > &&  input,
arma::Mat< eT > &&  error,
arma::Mat< eT > &&   
)
arma::mat const& Gradient ( ) const
inline

Get the gradient.

Definition at line 142 of file sequential.hpp.

arma::mat& Gradient ( )
inline

Modify the gradient.

Definition at line 144 of file sequential.hpp.

arma::mat const& InputParameter ( ) const
inline

Definition at line 127 of file sequential.hpp.

arma::mat& InputParameter ( )
inline

Modify the input parameter.

Definition at line 129 of file sequential.hpp.

std::vector<LayerTypes<CustomLayers...> >& Model ( )
inline

Return the model modules.

Definition at line 112 of file sequential.hpp.

arma::mat const& OutputParameter ( ) const
inline

Get the output parameter.

Definition at line 132 of file sequential.hpp.

arma::mat& OutputParameter ( )
inline

Modify the output parameter.

Definition at line 134 of file sequential.hpp.

const arma::mat& Parameters ( ) const
inline

Return the initial point for the optimization.

Definition at line 123 of file sequential.hpp.

arma::mat& Parameters ( )
inline

Modify the initial point for the optimization.

Definition at line 125 of file sequential.hpp.

void serialize ( Archive &  ,
const unsigned  int 
)

Serialize the layer.


The documentation for this class was generated from the following files: