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);
82 void Forward(
const arma::Mat<eT>& input, arma::Mat<eT>& output);
93 const arma::Mat<eT>& gy,
102 OutputDataType
const&
Delta()
const {
return delta; }
104 OutputDataType&
Delta() {
return delta; }
112 double Ratio()
const {
return ratio; }
118 scale = 1.0 / (1.0 - ratio);
124 template<
typename Archive>
125 void serialize(Archive& ar,
const uint32_t );
129 OutputDataType delta;
132 OutputDataType outputParameter;
151 #include "dropout_impl.hpp" 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.
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
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.
Dropout & operator=(const Dropout &layer)
Copy assignment operator.