16 #ifndef MLPACK_METHODS_ANN_LAYER_ALPHA_DROPOUT_HPP 17 #define MLPACK_METHODS_ANN_LAYER_ALPHA_DROPOUT_HPP 47 template <
typename InputDataType = arma::mat,
48 typename OutputDataType = arma::mat>
59 const double alphaDash = -alpha * lambda);
68 void Forward(
const arma::Mat<eT>&& input, arma::Mat<eT>&& output);
78 void Backward(
const arma::Mat<eT>&& ,
88 OutputDataType
const&
Delta()
const {
return delta; }
90 OutputDataType&
Delta() {
return delta; }
98 double Ratio()
const {
return ratio; }
101 double A()
const {
return a; }
104 double B()
const {
return b; }
110 OutputDataType
const&
Mask()
const {
return mask;}
117 a = pow((1 - ratio) * (1 + ratio * pow(alphaDash, 2)), -0.5);
118 b = -a * alphaDash * ratio;
124 template<
typename Archive>
125 void serialize(Archive& ar,
const unsigned int );
129 OutputDataType delta;
132 OutputDataType outputParameter;
147 static constexpr
double alpha = 1.6732632423543772848170429916717;
150 static constexpr
double lambda = 1.0507009873554804934193349852946;
163 #include "alpha_dropout_impl.hpp" bool & Deterministic()
Modify the value of the deterministic parameter.
double A() const
Value to be multiplied with x for affine transformation.
AlphaDropout(const double ratio=0.5, const double alphaDash=-alpha *lambda)
Create the Alpha_Dropout object using the specified ratio.
double Ratio() const
The probability of setting a value to alphaDash.
The core includes that mlpack expects; standard C++ includes and Armadillo.
double AlphaDash() const
Value of alphaDash.
void Forward(const arma::Mat< eT > &&input, arma::Mat< eT > &&output)
Ordinary feed forward pass of the alpha_dropout layer.
OutputDataType & OutputParameter()
Modify the output parameter.
OutputDataType const & Mask() const
Get the mask.
double B() const
Value to be added to a*x for affine transformation.
OutputDataType const & Delta() const
Get the detla.
void Ratio(const double r)
Modify the probability of setting a value to alphaDash.
The alpha - dropout layer is a regularizer that randomly with probability 'ratio' sets input values t...
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
bool Deterministic() const
The value of the deterministic parameter.
OutputDataType const & OutputParameter() const
Get the output parameter.
OutputDataType & Delta()
Modify the delta.
void Backward(const arma::Mat< eT > &&, arma::Mat< eT > &&gy, arma::Mat< eT > &&g)
Ordinary feed backward pass of the alpha_dropout layer.