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
64 Dropout(
const double ratio = 0.5,
const bool rescale =
true);
73 void Forward(
const arma::Mat<eT>&& input, arma::Mat<eT>&& output);
83 void Backward(
const arma::Mat<eT>&& ,
98 OutputDataType
const&
Delta()
const {
return delta; }
100 OutputDataType&
Delta() {
return delta; }
108 double Ratio()
const {
return ratio; }
114 scale = 1.0 / (1.0 - ratio);
125 template<
typename Archive>
126 void serialize(Archive& ar,
const unsigned int );
130 OutputDataType delta;
133 InputDataType inputParameter;
136 OutputDataType outputParameter;
158 #include "dropout_impl.hpp" InputDataType const & InputParameter() const
Get the input parameter.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
void Ratio(const double r)
Modify the probability of setting a value to zero.
OutputDataType & Delta()
Modify the delta.
The core includes that mlpack expects; standard C++ includes and Armadillo.
bool & Deterministic()
Modify the value of the deterministic parameter.
OutputDataType const & Delta() const
Get the detla.
void Backward(const arma::Mat< eT > &&, arma::Mat< eT > &&gy, arma::Mat< eT > &&g)
Ordinary feed backward pass of the dropout layer.
void Forward(const arma::Mat< eT > &&input, arma::Mat< eT > &&output)
Ordinary feed forward pass of the dropout layer.
bool & Rescale()
Modify the value of the rescale parameter.
bool Rescale() const
The value of the rescale parameter.
double Ratio() const
The probability of setting a value to zero.
OutputDataType const & OutputParameter() const
Get the output parameter.
InputDataType & InputParameter()
Modify the input parameter.
The dropout layer is a regularizer that randomly with probability ratio sets input values to zero and...
OutputDataType & OutputParameter()
Modify the output parameter.
bool Deterministic() const
The value of the deterministic parameter.
Dropout(const double ratio=0.5, const bool rescale=true)
Create the Dropout object using the specified ratio and rescale parameter.