|
mlpack
|
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...
#include <dropout.hpp>
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. | |
| Dropout (const Dropout &&) | |
| Move Constructor. | |
| Dropout & | operator= (const Dropout &layer) |
| Copy assignment operator. | |
| Dropout & | operator= (Dropout &&layer) |
| Move assignment operator. | |
| template<typename eT > | |
| void | Forward (const arma::Mat< eT > &input, arma::Mat< eT > &output) |
| Ordinary feed forward pass of the dropout layer. 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 & | OutputParameter () const |
| Get the output parameter. | |
| OutputDataType & | OutputParameter () |
| Modify the output parameter. | |
| OutputDataType const & | Delta () const |
| Get the detla. | |
| OutputDataType & | Delta () |
| Modify the delta. | |
| bool | Deterministic () const |
| The value of the deterministic parameter. | |
| bool & | Deterministic () |
| Modify the value of the deterministic parameter. | |
| double | Ratio () const |
| The probability of setting a value to zero. | |
| void | Ratio (const double r) |
| Modify the probability of setting a value to zero. | |
| template<typename Archive > | |
| void | serialize (Archive &ar, const uint32_t) |
| Serialize the layer. | |
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). |
| mlpack::ann::Dropout< InputDataType, OutputDataType >::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 mlpack::ann::Dropout< InputDataType, OutputDataType >::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. |
| void mlpack::ann::Dropout< InputDataType, OutputDataType >::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. |
1.8.13