Modified according to comments

This commit is contained in:
Sourabh Varshney
2018-04-04 00:31:20 +05:30
parent 2f1e4a6c83
commit 16640dfeb4
2 changed files with 7 additions and 5 deletions
@@ -55,8 +55,9 @@ class AlphaDropout
* Create the Alpha_Dropout object using the specified ratio.
*
* @param ratio The probability of setting a value to alphaDash.
* @param alphaDash The initial value for alphaDash.
*/
AlphaDropout(const double ratio = 0.5);
AlphaDropout(const double ratio = 0.5, double alphaDash = -alpha * lambda);
/**
* Ordinary feed forward pass of the alpha_dropout layer.
@@ -151,10 +152,10 @@ class AlphaDropout
bool deterministic;
//! Value of alpha for normalized inputs (taken from SELU)
const double alpha = 1.6732632423543772848170429916717;
constexpr double alpha = 1.6732632423543772848170429916717;
//! Value of lambda for normalized inputs (taken from SELU)
const double lambda = 1.0507009873554804934193349852946;
constexpr double lambda = 1.0507009873554804934193349852946;
//! The low variance value of SELU activation function.
double alphaDash;
@@ -24,11 +24,12 @@ namespace ann /** Artificial Neural Network. */ {
template<typename InputDataType, typename OutputDataType>
AlphaDropout<InputDataType, OutputDataType>::AlphaDropout(
const double ratio) :
const double ratio,
double alphaDash) :
ratio(ratio),
alphaDash(alphaDash),
deterministic(false)
{
alphaDash = - alpha * lambda;
Ratio(ratio);
}