mlpack
Public Member Functions | List of all members
mlpack::ann::SpatialDropout< InputDataType, OutputDataType > Class Template Reference

Implementation of the SpatialDropout layer. More...

#include <spatial_dropout.hpp>

Public Member Functions

 SpatialDropout ()
 Create the SpatialDropout object.
 
 SpatialDropout (const size_t size, const double ratio=0.5)
 Create the SpatialDropout object using the specified parameters. More...
 
template<typename eT >
void Forward (const arma::Mat< eT > &input, arma::Mat< eT > &output)
 Ordinary feed forward pass of the SpatialDropout layer. More...
 
template<typename eT >
void Backward (const arma::Mat< eT > &input, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
 Ordinary feed backward pass of the SpatialDropout layer. More...
 
OutputDataType const & OutputParameter () const
 Get the output parameter.
 
OutputDataType & OutputParameter ()
 Modify the output parameter.
 
OutputDataType const & Delta () const
 Get the delta.
 
OutputDataType & Delta ()
 Modify the delta.
 
size_t Size () const
 Get the number of channels.
 
size_t & Size ()
 Modify the number of channels.
 
bool Deterministic () const
 Get the value of the deterministic parameter.
 
bool & Deterministic ()
 Modify the value of the deterministic parameter.
 
double Ratio () const
 Get the probability value.
 
void Ratio (const double r)
 Modify the probability value.
 
template<typename Archive >
void serialize (Archive &ar, const uint32_t)
 Serialize the layer.
 

Detailed Description

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
class mlpack::ann::SpatialDropout< InputDataType, OutputDataType >

Implementation of the SpatialDropout layer.

For more information, refer to the following paper,

@article{Tompson15,
author = {Jonathan Tompson, Ross Goroshin, Arjun Jain,
Yann LeCun, Christopher Bregler},
title = {Efficient Object Localization Using Convolutional Networks},
journal = {CoRR},
volume = {abs/1411.4280},
year = {2015},
url = {https://arxiv.org/abs/1411.4280},
eprint = {1411.4280},
}
Template Parameters
InputDataTypeType of the input data (arma::colvec, arma::mat, arma::sp_mat or arma::cube).
OutputDataTypeType of the output data (arma::colvec, arma::mat, arma::sp_mat or arma::cube).

Constructor & Destructor Documentation

◆ SpatialDropout()

template<typename InputDataType , typename OutputDataType >
mlpack::ann::SpatialDropout< InputDataType, OutputDataType >::SpatialDropout ( const size_t  size,
const double  ratio = 0.5 
)

Create the SpatialDropout object using the specified parameters.

Parameters
sizeThe number of channels of each input image.
ratioThe probability of each channel getting dropped.

Member Function Documentation

◆ Backward()

template<typename InputDataType , typename OutputDataType >
template<typename eT >
void mlpack::ann::SpatialDropout< InputDataType, OutputDataType >::Backward ( const arma::Mat< eT > &  input,
const arma::Mat< eT > &  gy,
arma::Mat< eT > &  g 
)

Ordinary feed backward pass of the SpatialDropout layer.

Parameters
inputThe propagated input activation.
gyThe backpropagated error.
gThe calculated gradient.

◆ Forward()

template<typename InputDataType , typename OutputDataType >
template<typename eT >
void mlpack::ann::SpatialDropout< InputDataType, OutputDataType >::Forward ( const arma::Mat< eT > &  input,
arma::Mat< eT > &  output 
)

Ordinary feed forward pass of the SpatialDropout layer.

Parameters
inputInput data used for evaluating the specified function.
outputResulting output activation.

The documentation for this class was generated from the following files: