13 #ifndef MLPACK_METHODS_ANN_LAYER_DROPOUT_HPP 14 #define MLPACK_METHODS_ANN_LAYER_DROPOUT_HPP 51 template<
typename InputDataType = arma::mat,
52 typename OutputDataType = arma::mat>
61 Dropout(
const double ratio = 0.5);
70 void Forward(
const arma::Mat<eT>& input, arma::Mat<eT>& output);
81 const arma::Mat<eT>& gy,
90 OutputDataType
const&
Delta()
const {
return delta; }
92 OutputDataType&
Delta() {
return delta; }
100 double Ratio()
const {
return ratio; }
106 scale = 1.0 / (1.0 - ratio);
112 template<
typename Archive>
113 void serialize(Archive& ar,
const unsigned int );
117 OutputDataType delta;
120 OutputDataType outputParameter;
139 #include "dropout_impl.hpp" void serialize(Archive &ar, const unsigned int)
Serialize the layer.
Linear algebra utility functions, generally performed on matrices or vectors.
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.
Dropout(const double ratio=0.5)
Create the Dropout object using the specified ratio parameter.
double Ratio() const
The probability of setting a value to zero.
void Backward(const arma::Mat< eT > &, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
Ordinary feed backward pass of the dropout layer.
OutputDataType const & OutputParameter() const
Get the output parameter.
The dropout layer is a regularizer that randomly with probability 'ratio' sets input values to zero a...
OutputDataType & OutputParameter()
Modify the output 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.