SpatialDropout< InputDataType, OutputDataType > Class Template Reference

Implementation of the SpatialDropout layer. More...

Public Member Functions

 SpatialDropout ()
 Create the SpatialDropout object. More...

 
 SpatialDropout (const size_t size, const double ratio=0.5)
 Create the SpatialDropout object using the specified parameters. 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 & Delta () const
 Get the delta. More...

 
OutputDataType & Delta ()
 Modify the delta. More...

 
bool Deterministic () const
 Get 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 SpatialDropout layer. More...

 
OutputDataType const & OutputParameter () const
 Get the output parameter. More...

 
OutputDataType & OutputParameter ()
 Modify the output parameter. More...

 
double Ratio () const
 Get the probability value. More...

 
void Ratio (const double r)
 Modify the probability value. More...

 
template
<
typename
Archive
>
void serialize (Archive &ar, const uint32_t)
 Serialize the layer. More...

 
size_t Size () const
 Get the number of channels. More...

 
size_t & Size ()
 Modify the number of channels. More...

 

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).

Definition at line 48 of file spatial_dropout.hpp.

Constructor & Destructor Documentation

◆ SpatialDropout() [1/2]

Create the SpatialDropout object.

◆ SpatialDropout() [2/2]

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()

void 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.

◆ Delta() [1/2]

OutputDataType const& Delta ( ) const
inline

Get the delta.

Definition at line 88 of file spatial_dropout.hpp.

◆ Delta() [2/2]

OutputDataType& Delta ( )
inline

Modify the delta.

Definition at line 90 of file spatial_dropout.hpp.

◆ Deterministic() [1/2]

bool Deterministic ( ) const
inline

Get the value of the deterministic parameter.

Definition at line 99 of file spatial_dropout.hpp.

◆ Deterministic() [2/2]

bool& Deterministic ( )
inline

Modify the value of the deterministic parameter.

Definition at line 101 of file spatial_dropout.hpp.

◆ Forward()

void 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.

◆ OutputParameter() [1/2]

OutputDataType const& OutputParameter ( ) const
inline

Get the output parameter.

Definition at line 83 of file spatial_dropout.hpp.

◆ OutputParameter() [2/2]

OutputDataType& OutputParameter ( )
inline

Modify the output parameter.

Definition at line 85 of file spatial_dropout.hpp.

◆ Ratio() [1/2]

double Ratio ( ) const
inline

Get the probability value.

Definition at line 104 of file spatial_dropout.hpp.

◆ Ratio() [2/2]

void Ratio ( const double  r)
inline

Modify the probability value.

Definition at line 107 of file spatial_dropout.hpp.

References SpatialDropout< InputDataType, OutputDataType >::serialize().

◆ serialize()

void serialize ( Archive &  ar,
const uint32_t   
)

Serialize the layer.

Referenced by SpatialDropout< InputDataType, OutputDataType >::Ratio().

◆ Size() [1/2]

size_t Size ( ) const
inline

Get the number of channels.

Definition at line 93 of file spatial_dropout.hpp.

◆ Size() [2/2]

size_t& Size ( )
inline

Modify the number of channels.

Definition at line 96 of file spatial_dropout.hpp.


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