The dropout layer is a regularizer that randomly with probability 'ratio' sets input values to zero and scales the remaining elements by factor 1 / (1 - ratio) rather than during test time so as to keep the expected sum same. More...
Public Member Functions | |
| Dropout (const double ratio=0.5) | |
| Create the Dropout object using the specified ratio parameter. More... | |
| Dropout (const Dropout &layer) | |
| Copy Constructor. More... | |
| Dropout (const Dropout &&) | |
| Move Constructor. More... | |
template < typename eT > | |
| void | Backward (const arma::Mat< eT > &, const arma::Mat< eT > &gy, arma::Mat< eT > &g) |
| Ordinary feed backward pass of the dropout layer. More... | |
| OutputDataType const & | Delta () const |
| Get the detla. More... | |
| OutputDataType & | Delta () |
| Modify the delta. More... | |
| bool | Deterministic () const |
| The value of the deterministic parameter. More... | |
| bool & | Deterministic () |
| Modify the value of the deterministic parameter. More... | |
template < typename eT > | |
| void | Forward (const arma::Mat< eT > &input, arma::Mat< eT > &output) |
| Ordinary feed forward pass of the dropout layer. More... | |
| Dropout & | operator= (const Dropout &layer) |
| Copy assignment operator. More... | |
| Dropout & | operator= (Dropout &&layer) |
| Move assignment operator. More... | |
| OutputDataType const & | OutputParameter () const |
| Get the output parameter. More... | |
| OutputDataType & | OutputParameter () |
| Modify the output parameter. More... | |
| double | Ratio () const |
| The probability of setting a value to zero. More... | |
| void | Ratio (const double r) |
| Modify the probability of setting a value to zero. More... | |
template < typename Archive > | |
| void | serialize (Archive &ar, const uint32_t) |
| Serialize the layer. More... | |
The dropout layer is a regularizer that randomly with probability 'ratio' sets input values to zero and scales the remaining elements by factor 1 / (1 - ratio) rather than during test time so as to keep the expected sum same.
In the deterministic mode (during testing), there is no change in the input.
Note: During training you should set deterministic to false and during testing you should set deterministic to true.
For more information, see the following.
| InputDataType | Type of the input data (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
| OutputDataType | Type of the output data (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
Definition at line 53 of file dropout.hpp.
| Dropout | ( | const double | ratio = 0.5 | ) |
Create the Dropout object using the specified ratio parameter.
| ratio | 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.
| * | (input) The propagated input activation. |
| gy | The backpropagated error. |
| g | The calculated gradient. |
|
inline |
Get the detla.
Definition at line 102 of file dropout.hpp.
|
inline |
Modify the delta.
Definition at line 104 of file dropout.hpp.
|
inline |
The value of the deterministic parameter.
Definition at line 107 of file dropout.hpp.
|
inline |
Modify the value of the deterministic parameter.
Definition at line 109 of file dropout.hpp.
| void Forward | ( | const arma::Mat< eT > & | input, |
| arma::Mat< eT > & | output | ||
| ) |
Ordinary feed forward pass of the dropout layer.
| input | Input data used for evaluating the specified function. |
| output | Resulting output activation. |
Copy assignment operator.
|
inline |
Get the output parameter.
Definition at line 97 of file dropout.hpp.
|
inline |
Modify the output parameter.
Definition at line 99 of file dropout.hpp.
|
inline |
The probability of setting a value to zero.
Definition at line 112 of file dropout.hpp.
|
inline |
Modify the probability of setting a value to zero.
Definition at line 115 of file dropout.hpp.
References Dropout< InputDataType, OutputDataType >::serialize().
| void serialize | ( | Archive & | ar, |
| const uint32_t | |||
| ) |
Serialize the layer.
Referenced by Dropout< InputDataType, OutputDataType >::Ratio().