\section{Spatial\+Dropout$<$ Input\+Data\+Type, Output\+Data\+Type $>$ Class Template Reference}
\label{classmlpack_1_1ann_1_1SpatialDropout}\index{Spatial\+Dropout$<$ Input\+Data\+Type, Output\+Data\+Type $>$@{Spatial\+Dropout$<$ Input\+Data\+Type, Output\+Data\+Type $>$}}


Implementation of the \doxyref{Spatial\+Dropout}{p.}{classmlpack_1_1ann_1_1SpatialDropout} layer.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Spatial\+Dropout} ()
\begin{DoxyCompactList}\small\item\em Create the \doxyref{Spatial\+Dropout}{p.}{classmlpack_1_1ann_1_1SpatialDropout} object. \end{DoxyCompactList}\item 
\textbf{ Spatial\+Dropout} (const size\+\_\+t size, const double ratio=0.\+5)
\begin{DoxyCompactList}\small\item\em Create the \doxyref{Spatial\+Dropout}{p.}{classmlpack_1_1ann_1_1SpatialDropout} object using the specified parameters. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename eT $>$ }\\void \textbf{ Backward} (const arma\+::\+Mat$<$ eT $>$ \&input, const arma\+::\+Mat$<$ eT $>$ \&gy, arma\+::\+Mat$<$ eT $>$ \&g)
\begin{DoxyCompactList}\small\item\em Ordinary feed backward pass of the \doxyref{Spatial\+Dropout}{p.}{classmlpack_1_1ann_1_1SpatialDropout} layer. \end{DoxyCompactList}\item 
Output\+Data\+Type const  \& \textbf{ Delta} () const
\begin{DoxyCompactList}\small\item\em Get the delta. \end{DoxyCompactList}\item 
Output\+Data\+Type \& \textbf{ Delta} ()
\begin{DoxyCompactList}\small\item\em Modify the delta. \end{DoxyCompactList}\item 
bool \textbf{ Deterministic} () const
\begin{DoxyCompactList}\small\item\em Get the value of the deterministic parameter. \end{DoxyCompactList}\item 
bool \& \textbf{ Deterministic} ()
\begin{DoxyCompactList}\small\item\em Modify the value of the deterministic parameter. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename eT $>$ }\\void \textbf{ Forward} (const arma\+::\+Mat$<$ eT $>$ \&input, arma\+::\+Mat$<$ eT $>$ \&output)
\begin{DoxyCompactList}\small\item\em Ordinary feed forward pass of the \doxyref{Spatial\+Dropout}{p.}{classmlpack_1_1ann_1_1SpatialDropout} layer. \end{DoxyCompactList}\item 
Output\+Data\+Type const  \& \textbf{ Output\+Parameter} () const
\begin{DoxyCompactList}\small\item\em Get the output parameter. \end{DoxyCompactList}\item 
Output\+Data\+Type \& \textbf{ Output\+Parameter} ()
\begin{DoxyCompactList}\small\item\em Modify the output parameter. \end{DoxyCompactList}\item 
double \textbf{ Ratio} () const
\begin{DoxyCompactList}\small\item\em Get the probability value. \end{DoxyCompactList}\item 
void \textbf{ Ratio} (const double r)
\begin{DoxyCompactList}\small\item\em Modify the probability value. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Archive $>$ }\\void \textbf{ serialize} (Archive \&ar, const unsigned int)
\begin{DoxyCompactList}\small\item\em Serialize the layer. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Size} () const
\begin{DoxyCompactList}\small\item\em Get the number of channels. \end{DoxyCompactList}\item 
size\+\_\+t \& \textbf{ Size} ()
\begin{DoxyCompactList}\small\item\em Modify the number of channels. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename Input\+Data\+Type = arma\+::mat, typename Output\+Data\+Type = arma\+::mat$>$\newline
class mlpack\+::ann\+::\+Spatial\+Dropout$<$ Input\+Data\+Type, Output\+Data\+Type $>$}

Implementation of the \doxyref{Spatial\+Dropout}{p.}{classmlpack_1_1ann_1_1SpatialDropout} layer. 

For more information, refer to the following paper,


\begin{DoxyCode}
@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:\textcolor{comment}{//arxiv.org/abs/1411.4280\},}
  eprint    = \{1411.4280\},
\}
\end{DoxyCode}



\begin{DoxyTemplParams}{Template Parameters}
{\em Input\+Data\+Type} & Type of the input data (arma\+::colvec, arma\+::mat, arma\+::sp\+\_\+mat or arma\+::cube). \\
\hline
{\em Output\+Data\+Type} & Type of the output data (arma\+::colvec, arma\+::mat, arma\+::sp\+\_\+mat or arma\+::cube). \\
\hline
\end{DoxyTemplParams}


Definition at line 48 of file spatial\+\_\+dropout.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_a9bcbfff9c317c54764d9043d9339bb63}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!Spatial\+Dropout@{Spatial\+Dropout}}
\index{Spatial\+Dropout@{Spatial\+Dropout}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{Spatial\+Dropout()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \textbf{ Spatial\+Dropout} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Create the \doxyref{Spatial\+Dropout}{p.}{classmlpack_1_1ann_1_1SpatialDropout} object. 

\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_a2713a35ecf6f9d9d750e9cbaaf293ca8}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!Spatial\+Dropout@{Spatial\+Dropout}}
\index{Spatial\+Dropout@{Spatial\+Dropout}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{Spatial\+Dropout()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \textbf{ Spatial\+Dropout} (\begin{DoxyParamCaption}\item[{const size\+\_\+t}]{size,  }\item[{const double}]{ratio = {\ttfamily 0.5} }\end{DoxyParamCaption})}



Create the \doxyref{Spatial\+Dropout}{p.}{classmlpack_1_1ann_1_1SpatialDropout} object using the specified parameters. 


\begin{DoxyParams}{Parameters}
{\em size} & The number of channels of each input image. \\
\hline
{\em ratio} & The probability of each channel getting dropped. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_a78dbad83871f43db1975e45a9a69c376}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!Backward@{Backward}}
\index{Backward@{Backward}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{Backward()}
{\footnotesize\ttfamily void Backward (\begin{DoxyParamCaption}\item[{const arma\+::\+Mat$<$ eT $>$ \&}]{input,  }\item[{const arma\+::\+Mat$<$ eT $>$ \&}]{gy,  }\item[{arma\+::\+Mat$<$ eT $>$ \&}]{g }\end{DoxyParamCaption})}



Ordinary feed backward pass of the \doxyref{Spatial\+Dropout}{p.}{classmlpack_1_1ann_1_1SpatialDropout} layer. 


\begin{DoxyParams}{Parameters}
{\em input} & The propagated input activation. \\
\hline
{\em gy} & The backpropagated error. \\
\hline
{\em g} & The calculated gradient. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_a797f7edb44dd081e5e2b3cc316eef6bd}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!Delta@{Delta}}
\index{Delta@{Delta}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{Delta()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Output\+Data\+Type const\& Delta (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the delta. 



Definition at line 88 of file spatial\+\_\+dropout.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_ad6601342d560219ce951d554e69e5e87}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!Delta@{Delta}}
\index{Delta@{Delta}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{Delta()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily Output\+Data\+Type\& Delta (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the delta. 



Definition at line 90 of file spatial\+\_\+dropout.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_a9f4103707f4d199ce5594d239b60443e}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!Deterministic@{Deterministic}}
\index{Deterministic@{Deterministic}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{Deterministic()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily bool Deterministic (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the value of the deterministic parameter. 



Definition at line 99 of file spatial\+\_\+dropout.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_a42d4ee3da432cff20d3a41b8b1ec801c}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!Deterministic@{Deterministic}}
\index{Deterministic@{Deterministic}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{Deterministic()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily bool\& Deterministic (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the value of the deterministic parameter. 



Definition at line 101 of file spatial\+\_\+dropout.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_a461f849bc638c15bec262dc9c3a58abe}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!Forward@{Forward}}
\index{Forward@{Forward}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{Forward()}
{\footnotesize\ttfamily void Forward (\begin{DoxyParamCaption}\item[{const arma\+::\+Mat$<$ eT $>$ \&}]{input,  }\item[{arma\+::\+Mat$<$ eT $>$ \&}]{output }\end{DoxyParamCaption})}



Ordinary feed forward pass of the \doxyref{Spatial\+Dropout}{p.}{classmlpack_1_1ann_1_1SpatialDropout} layer. 


\begin{DoxyParams}{Parameters}
{\em input} & Input data used for evaluating the specified function. \\
\hline
{\em output} & Resulting output activation. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_a0ee21c2a36e5abad1e7a9d5dd00849f9}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{Output\+Parameter()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Output\+Data\+Type const\& Output\+Parameter (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the output parameter. 



Definition at line 83 of file spatial\+\_\+dropout.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_a21d5f745f02c709625a4ee0907f004a5}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{Output\+Parameter()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily Output\+Data\+Type\& Output\+Parameter (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the output parameter. 



Definition at line 85 of file spatial\+\_\+dropout.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_a0052f2d1427761ea25fb01a05d966a40}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!Ratio@{Ratio}}
\index{Ratio@{Ratio}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{Ratio()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily double Ratio (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the probability value. 



Definition at line 104 of file spatial\+\_\+dropout.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_a9ca65c8f62aa7b45b5b08899d83d2821}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!Ratio@{Ratio}}
\index{Ratio@{Ratio}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{Ratio()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void Ratio (\begin{DoxyParamCaption}\item[{const double}]{r }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the probability value. 



Definition at line 107 of file spatial\+\_\+dropout.\+hpp.



References Spatial\+Dropout$<$ Input\+Data\+Type, Output\+Data\+Type $>$\+::serialize().

\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{ar,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})}



Serialize the layer. 



Referenced by Spatial\+Dropout$<$ Input\+Data\+Type, Output\+Data\+Type $>$\+::\+Ratio().

\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_a58f4b9e873b7c1c7d512bd9f7d1489d8}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!Size@{Size}}
\index{Size@{Size}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{Size()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily size\+\_\+t Size (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the number of channels. 



Definition at line 93 of file spatial\+\_\+dropout.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1SpatialDropout_a0d09cdf6f07a1dfbc752236a0c8576ba}} 
\index{mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}!Size@{Size}}
\index{Size@{Size}!mlpack\+::ann\+::\+Spatial\+Dropout@{mlpack\+::ann\+::\+Spatial\+Dropout}}
\subsubsection{Size()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily size\+\_\+t\& Size (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [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\+:\begin{DoxyCompactItemize}
\item 
/var/www/mlpack.\+ratml.\+org/mlpack.\+org/\+\_\+src/mlpack-\/git/src/mlpack/methods/ann/layer/\textbf{ spatial\+\_\+dropout.\+hpp}\end{DoxyCompactItemize}
