16 #ifndef MLPACK_METHODS_ANN_LAYER_ALPHA_DROPOUT_HPP 17 #define MLPACK_METHODS_ANN_LAYER_ALPHA_DROPOUT_HPP 48 template <
typename InputDataType = arma::mat,
49 typename OutputDataType = arma::mat>
60 const double alphaDash = -alpha * lambda);
69 void Forward(
const arma::Mat<eT>& input, arma::Mat<eT>& output);
80 const arma::Mat<eT>& gy,
89 OutputDataType
const&
Delta()
const {
return delta; }
91 OutputDataType&
Delta() {
return delta; }
99 double Ratio()
const {
return ratio; }
102 double A()
const {
return a; }
105 double B()
const {
return b; }
111 OutputDataType
const&
Mask()
const {
return mask;}
118 a = pow((1 - ratio) * (1 + ratio * pow(alphaDash, 2)), -0.5);
119 b = -a * alphaDash * ratio;
125 template<
typename Archive>
126 void serialize(Archive& ar,
const uint32_t );
130 OutputDataType delta;
133 OutputDataType outputParameter;
148 static constexpr
double alpha = 1.6732632423543772848170429916717;
151 static constexpr
double lambda = 1.0507009873554804934193349852946;
164 #include "alpha_dropout_impl.hpp" bool & Deterministic()
Modify the value of the deterministic parameter.
void Backward(const arma::Mat< eT > &, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
Ordinary feed backward pass of the alpha_dropout layer.
Linear algebra utility functions, generally performed on matrices or vectors.
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.
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
double AlphaDash() const
Value of alphaDash.
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 Forward(const arma::Mat< eT > &input, arma::Mat< eT > &output)
Ordinary feed forward pass of the alpha_dropout layer.
bool Deterministic() const
The value of the deterministic parameter.
OutputDataType const & OutputParameter() const
Get the output parameter.
OutputDataType & Delta()
Modify the delta.