mlpack  master
Public Member Functions | Private Attributes | List of all members
mlpack::ann::MultiplyConstant< InputDataType, OutputDataType > Class Template Reference

Implementation of the multiply constant layer. More...

Public Member Functions

 MultiplyConstant (const double scalar)
 Create the MultiplyConstant object. More...
 
template<typename DataType >
void Backward (const DataType &&, DataType &&gy, DataType &&g)
 Ordinary feed backward pass of a neural network. More...
 
OutputDataType & Delta () const
 Get the delta. More...
 
OutputDataType & Delta ()
 Modify the delta. More...
 
template<typename InputType , typename OutputType >
void Forward (const InputType &&input, OutputType &&output)
 Ordinary feed forward pass of a neural network. More...
 
InputDataType & InputParameter () const
 Get the input parameter. More...
 
InputDataType & InputParameter ()
 Modify the input parameter. More...
 
OutputDataType & OutputParameter () const
 Get the output parameter. More...
 
OutputDataType & OutputParameter ()
 Modify the output parameter. More...
 
template<typename Archive >
void Serialize (Archive &ar, const unsigned int)
 Serialize the layer. More...
 

Private Attributes

OutputDataType delta
 Locally-stored delta object. More...
 
InputDataType inputParameter
 Locally-stored input parameter object. More...
 
OutputDataType outputParameter
 Locally-stored output parameter object. More...
 
const double scalar
 Locally-stored constant scalar value. More...
 

Detailed Description

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
class mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >

Implementation of the multiply constant layer.

The multiply constant layer multiplies the input by a (non-learnable) constant.

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 29 of file multiply_constant.hpp.

Constructor & Destructor Documentation

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::MultiplyConstant ( const double  scalar)

Create the MultiplyConstant object.

Member Function Documentation

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
template<typename DataType >
void mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::Backward ( const DataType &&  ,
DataType &&  gy,
DataType &&  g 
)

Ordinary feed backward pass of a neural network.

The backward pass multiplies the error with the specified constant scalar value.

Parameters
inputThe propagated input activation.
gyThe backpropagated error.
gThe calculated gradient.
template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
OutputDataType& mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::Delta ( ) const
inline
template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
OutputDataType& mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::Delta ( )
inline
template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
template<typename InputType , typename OutputType >
void mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::Forward ( const InputType &&  input,
OutputType &&  output 
)

Ordinary feed forward pass of a neural network.

Multiply the input with the specified constant scalar value.

Parameters
inputInput data used for evaluating the specified function.
outputResulting output activation.
template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
InputDataType& mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::InputParameter ( ) const
inline

Get the input parameter.

Definition at line 59 of file multiply_constant.hpp.

References mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::inputParameter.

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
InputDataType& mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::InputParameter ( )
inline

Modify the input parameter.

Definition at line 61 of file multiply_constant.hpp.

References mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::inputParameter.

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
OutputDataType& mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::OutputParameter ( ) const
inline

Get the output parameter.

Definition at line 64 of file multiply_constant.hpp.

References mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::outputParameter.

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
OutputDataType& mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::OutputParameter ( )
inline

Modify the output parameter.

Definition at line 66 of file multiply_constant.hpp.

References mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::outputParameter.

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
template<typename Archive >
void mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::Serialize ( Archive &  ar,
const unsigned  int 
)

Member Data Documentation

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
OutputDataType mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::delta
private

Locally-stored delta object.

Definition at line 84 of file multiply_constant.hpp.

Referenced by mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::Delta().

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
InputDataType mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::inputParameter
private

Locally-stored input parameter object.

Definition at line 87 of file multiply_constant.hpp.

Referenced by mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::InputParameter().

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
OutputDataType mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::outputParameter
private

Locally-stored output parameter object.

Definition at line 90 of file multiply_constant.hpp.

Referenced by mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::OutputParameter().

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
const double mlpack::ann::MultiplyConstant< InputDataType, OutputDataType >::scalar
private

Locally-stored constant scalar value.

Definition at line 81 of file multiply_constant.hpp.


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