13 #ifndef MLPACK_METHODS_ANN_LAYER_DROPOUT_HPP 14 #define MLPACK_METHODS_ANN_LAYER_DROPOUT_HPP 51 typename InputDataType = arma::mat,
52 typename OutputDataType = arma::mat
73 void Forward(
const arma::Mat<eT>&& input, arma::Mat<eT>&& output);
83 void Backward(
const arma::Mat<eT>&& ,
125 template<
typename Archive>
126 void Serialize(Archive& ar,
const unsigned int );
158 #include "dropout_impl.hpp" Dropout(const double ratio=0.5, const bool rescale=true)
Create the Dropout object using the specified ratio and rescale parameter.
OutputDataType const & Delta() const
Get the detla.
Linear algebra utility functions, generally performed on matrices or vectors.
OutputDataType mask
Locally-stored mast object.
InputDataType inputParameter
Locally-stored input parameter object.
The core includes that mlpack expects; standard C++ includes and Armadillo.
bool & Deterministic()
Modify the value of the deterministic parameter.
OutputDataType & OutputParameter()
Modify the output parameter.
InputDataType const & InputParameter() const
Get the input parameter.
bool deterministic
If true dropout and scaling is disabled, see notes above.
OutputDataType delta
Locally-stored delta object.
OutputDataType const & OutputParameter() const
Get the output parameter.
void Ratio(const double r)
Modify the probability of setting a value to zero.
InputDataType & InputParameter()
Modify the input parameter.
void Backward(const arma::Mat< eT > &&, arma::Mat< eT > &&gy, arma::Mat< eT > &&g)
Ordinary feed backward pass of the dropout layer.
The dropout layer is a regularizer that randomly with probability ratio sets input values to zero and...
double scale
The scale fraction.
bool & Rescale()
Modify the value of the rescale parameter.
double Ratio() const
The probability of setting a value to zero.
OutputDataType & Delta()
Modify the delta.
OutputDataType outputParameter
Locally-stored output parameter object.
void Serialize(Archive &ar, const unsigned int)
Serialize the layer.
bool Rescale() const
The value of the rescale parameter.
bool Deterministic() const
The value of the deterministic parameter.
void Forward(const arma::Mat< eT > &&input, arma::Mat< eT > &&output)
Ordinary feed forward pass of the dropout layer.
bool rescale
If true the input is rescaled when deterministic is False.
double ratio
The probability of setting a value to zero.