13#ifndef MLPACK_METHODS_ANN_LAYER_DROPOUT_HPP
14#define MLPACK_METHODS_ANN_LAYER_DROPOUT_HPP
51template<
typename InputDataType = arma::mat,
52 typename OutputDataType = arma::mat>
70 void Forward(
const arma::Mat<eT>& input, arma::Mat<eT>& output);
81 const arma::Mat<eT>& gy,
90 OutputDataType
const&
Delta()
const {
return delta; }
92 OutputDataType&
Delta() {
return delta; }
100 double Ratio()
const {
return ratio; }
106 scale = 1.0 / (1.0 - ratio);
112 template<
typename Archive>
117 OutputDataType delta;
120 OutputDataType outputParameter;
139#include "dropout_impl.hpp"
The dropout layer is a regularizer that randomly with probability 'ratio' sets input values to zero a...
double Ratio() const
The probability of setting a value to zero.
OutputDataType const & Delta() const
Get the detla.
void Forward(const arma::Mat< eT > &input, arma::Mat< eT > &output)
Ordinary feed forward pass of the dropout layer.
OutputDataType const & OutputParameter() const
Get the output parameter.
Dropout(const double ratio=0.5)
Create the Dropout object using the specified ratio parameter.
void Ratio(const double r)
Modify the probability of setting a value to zero.
bool & Deterministic()
Modify the value of the deterministic parameter.
bool Deterministic() const
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 dropout layer.
OutputDataType & OutputParameter()
Modify the output parameter.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
OutputDataType & Delta()
Modify the delta.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.