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

The dropout layer is a regularizer that randomly with probability 'ratio' sets input values to zero and scales the remaining elements by factor 1 / (1 - ratio) rather than during test time so as to keep the expected sum same. More...

Public Member Functions

 Dropout (const double ratio=0.5)
 Create the Dropout object using the specified ratio parameter. More...
 
template<typename eT >
void Backward (const arma::Mat< eT > &&, arma::Mat< eT > &&gy, arma::Mat< eT > &&g)
 Ordinary feed backward pass of the dropout layer. More...
 
OutputDataType const & Delta () const
 Get the detla. More...
 
OutputDataType & Delta ()
 Modify the delta. More...
 
bool Deterministic () const
 The value of the deterministic parameter. More...
 
bool & Deterministic ()
 Modify the value of the deterministic parameter. More...
 
template<typename eT >
void Forward (const arma::Mat< eT > &&input, arma::Mat< eT > &&output)
 Ordinary feed forward pass of the dropout layer. More...
 
OutputDataType const & OutputParameter () const
 Get the output parameter. More...
 
OutputDataType & OutputParameter ()
 Modify the output parameter. More...
 
double Ratio () const
 The probability of setting a value to zero. More...
 
void Ratio (const double r)
 Modify the probability of setting a value to zero. More...
 
template<typename Archive >
void serialize (Archive &ar, const unsigned int)
 Serialize the layer. More...
 

Detailed Description

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

The dropout layer is a regularizer that randomly with probability 'ratio' sets input values to zero and scales the remaining elements by factor 1 / (1 - ratio) rather than during test time so as to keep the expected sum same.

In the deterministic mode (during testing), there is no change in the input.

Note: During training you should set deterministic to false and during testing you should set deterministic to true.

For more information, see the following.

* @article{Hinton2012,
* author = {Geoffrey E. Hinton, Nitish Srivastava, Alex Krizhevsky,
* Ilya Sutskever, Ruslan Salakhutdinov},
* title = {Improving neural networks by preventing co-adaptation of feature
* detectors},
* journal = {CoRR},
* volume = {abs/1207.0580},
* year = {2012},
* }
*
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 52 of file dropout.hpp.

Constructor & Destructor Documentation

Dropout ( const double  ratio = 0.5)

Create the Dropout object using the specified ratio parameter.

Parameters
ratioThe probability of setting a value to zero.

Member Function Documentation

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

Ordinary feed backward pass of the dropout layer.

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

Get the detla.

Definition at line 89 of file dropout.hpp.

OutputDataType& Delta ( )
inline

Modify the delta.

Definition at line 91 of file dropout.hpp.

bool Deterministic ( ) const
inline

The value of the deterministic parameter.

Definition at line 94 of file dropout.hpp.

bool& Deterministic ( )
inline

Modify the value of the deterministic parameter.

Definition at line 96 of file dropout.hpp.

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

Ordinary feed forward pass of the dropout layer.

Parameters
inputInput data used for evaluating the specified function.
outputResulting output activation.
OutputDataType const& OutputParameter ( ) const
inline

Get the output parameter.

Definition at line 84 of file dropout.hpp.

OutputDataType& OutputParameter ( )
inline

Modify the output parameter.

Definition at line 86 of file dropout.hpp.

double Ratio ( ) const
inline

The probability of setting a value to zero.

Definition at line 99 of file dropout.hpp.

void Ratio ( const double  r)
inline

Modify the probability of setting a value to zero.

Definition at line 102 of file dropout.hpp.

void serialize ( Archive &  ar,
const unsigned  int 
)

Serialize the layer.


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