mlpack
Public Member Functions | List of all members
mlpack::ann::BaseLayer< ActivationFunction, InputDataType, OutputDataType > Class Template Reference

Implementation of the base layer. More...

#include <base_layer.hpp>

Public Member Functions

 BaseLayer ()
 Create the BaseLayer object.
 
template<typename InputType , typename OutputType >
void Forward (const InputType &input, OutputType &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 Backward (const arma::Mat< eT > &input, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
 Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backwards trough f. More...
 
OutputDataType const & OutputParameter () const
 Get the output parameter.
 
OutputDataType & OutputParameter ()
 Modify the output parameter.
 
OutputDataType const & Delta () const
 Get the delta.
 
OutputDataType & Delta ()
 Modify the delta.
 
template<typename Archive >
void serialize (Archive &, const uint32_t)
 Serialize the layer.
 

Detailed Description

template<class ActivationFunction = LogisticFunction, typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
class mlpack::ann::BaseLayer< ActivationFunction, InputDataType, OutputDataType >

Implementation of the base layer.

The base layer works as a metaclass which attaches various functions to the embedding layer.

A few convenience typedefs are given:

Template Parameters
ActivationFunctionActivation function used for the embedding layer.
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).

Member Function Documentation

◆ Backward()

template<class ActivationFunction = LogisticFunction, typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
template<typename eT >
void mlpack::ann::BaseLayer< ActivationFunction, InputDataType, OutputDataType >::Backward ( const arma::Mat< eT > &  input,
const arma::Mat< eT > &  gy,
arma::Mat< eT > &  g 
)
inline

Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backwards trough f.

Using the results from the feed forward pass.

Parameters
inputThe propagated input activation.
gyThe backpropagated error.
gThe calculated gradient.

◆ Forward()

template<class ActivationFunction = LogisticFunction, typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
template<typename InputType , typename OutputType >
void mlpack::ann::BaseLayer< ActivationFunction, InputDataType, OutputDataType >::Forward ( const InputType &  input,
OutputType &  output 
)
inline

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.

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