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;
void Forward(const arma::Mat< eT > &input, arma::Mat< eT > &output)
Ordinary feed forward pass of the alpha_dropout layer.
Definition: alpha_dropout_impl.hpp:38
bool & Deterministic()
Modify the value of the deterministic parameter.
Definition: alpha_dropout.hpp:96
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.
double B() const
Value to be added to a*x for affine transformation.
Definition: alpha_dropout.hpp:105
double Ratio() const
The probability of setting a value to alphaDash.
Definition: alpha_dropout.hpp:99
OutputDataType const & OutputParameter() const
Get the output parameter.
Definition: alpha_dropout.hpp:84
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: alpha_dropout_impl.hpp:68
void Backward(const arma::Mat< eT > &, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
Ordinary feed backward pass of the alpha_dropout layer.
Definition: alpha_dropout_impl.hpp:60
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: alpha_dropout.hpp:86
OutputDataType const & Delta() const
Get the detla.
Definition: alpha_dropout.hpp:89
OutputDataType const & Mask() const
Get the mask.
Definition: alpha_dropout.hpp:111
double AlphaDash() const
Value of alphaDash.
Definition: alpha_dropout.hpp:108
void Ratio(const double r)
Modify the probability of setting a value to alphaDash.
Definition: alpha_dropout.hpp:115
AlphaDropout(const double ratio=0.5, const double alphaDash=-alpha *lambda)
Create the Alpha_Dropout object using the specified ratio.
Definition: alpha_dropout_impl.hpp:26
The alpha - dropout layer is a regularizer that randomly with probability 'ratio' sets input values t...
Definition: alpha_dropout.hpp:50
double A() const
Value to be multiplied with x for affine transformation.
Definition: alpha_dropout.hpp:102
bool Deterministic() const
The value of the deterministic parameter.
Definition: alpha_dropout.hpp:94
OutputDataType & Delta()
Modify the delta.
Definition: alpha_dropout.hpp:91