\section{C\+Re\+LU$<$ Input\+Data\+Type, Output\+Data\+Type $>$ Class Template Reference}
\label{classmlpack_1_1ann_1_1CReLU}\index{C\+Re\+L\+U$<$ Input\+Data\+Type, Output\+Data\+Type $>$@{C\+Re\+L\+U$<$ Input\+Data\+Type, Output\+Data\+Type $>$}}


A concatenated Re\+LU has two outputs, one Re\+LU and one negative Re\+LU, concatenated together.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ C\+Re\+LU} ()
\begin{DoxyCompactList}\small\item\em Create the \doxyref{C\+Re\+LU}{p.}{classmlpack_1_1ann_1_1CReLU} object. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Data\+Type $>$ }\\void \textbf{ Backward} (const Data\+Type \&input, const Data\+Type \&gy, Data\+Type \&g)
\begin{DoxyCompactList}\small\item\em Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backwards through f. \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 
{\footnotesize template$<$typename Input\+Type , typename Output\+Type $>$ }\\void \textbf{ Forward} (const Input\+Type \&input, Output\+Type \&output)
\begin{DoxyCompactList}\small\item\em Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activity forward through f. \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 
{\footnotesize template$<$typename Archive $>$ }\\void \textbf{ serialize} (Archive \&, const unsigned int)
\begin{DoxyCompactList}\small\item\em Serialize the layer. \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\+::\+C\+Re\+L\+U$<$ Input\+Data\+Type, Output\+Data\+Type $>$}

A concatenated Re\+LU has two outputs, one Re\+LU and one negative Re\+LU, concatenated together. 

In other words, for positive x it produces [x, 0], and for negative x it produces [0, x]. Because it has two outputs, \doxyref{C\+Re\+LU}{p.}{classmlpack_1_1ann_1_1CReLU} doubles the output dimension.

Note\+: The \doxyref{C\+Re\+LU}{p.}{classmlpack_1_1ann_1_1CReLU} doubles the output size.

For more information, see the following.


\begin{DoxyCode}
@inproceedings\{ICML2016,
  title  = \{Understanding and Improving Convolutional Neural Networks
            via Concatenated Rectified Linear Units\},
  author = \{LWenling Shang, Kihyuk Sohn, Diogo Almeida, Honglak Lee\},
  year   = \{2016\},
  url    = \{https:\textcolor{comment}{//arxiv.org/abs/1603.05201\}}
\}
\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 50 of file c\+\_\+relu.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1ann_1_1CReLU_a25aa935d5a2be5066422e9dc6d5e80b8}} 
\index{mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}!C\+Re\+LU@{C\+Re\+LU}}
\index{C\+Re\+LU@{C\+Re\+LU}!mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}}
\subsubsection{C\+Re\+L\+U()}
{\footnotesize\ttfamily \textbf{ C\+Re\+LU} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Create the \doxyref{C\+Re\+LU}{p.}{classmlpack_1_1ann_1_1CReLU} object. 



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1ann_1_1CReLU_aef8c56f1f8624bd006afec8b3bcda9d6}} 
\index{mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}!Backward@{Backward}}
\index{Backward@{Backward}!mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}}
\subsubsection{Backward()}
{\footnotesize\ttfamily void Backward (\begin{DoxyParamCaption}\item[{const Data\+Type \&}]{input,  }\item[{const Data\+Type \&}]{gy,  }\item[{Data\+Type \&}]{g }\end{DoxyParamCaption})}



Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backwards through f. 

Using the results from the feed forward pass.


\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_1CReLU_a797f7edb44dd081e5e2b3cc316eef6bd}} 
\index{mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}!Delta@{Delta}}
\index{Delta@{Delta}!mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}}
\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 87 of file c\+\_\+relu.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1CReLU_ad6601342d560219ce951d554e69e5e87}} 
\index{mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}!Delta@{Delta}}
\index{Delta@{Delta}!mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}}
\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 89 of file c\+\_\+relu.\+hpp.



References C\+Re\+L\+U$<$ Input\+Data\+Type, Output\+Data\+Type $>$\+::serialize().

\mbox{\label{classmlpack_1_1ann_1_1CReLU_a09440df0a90bdcc766e56e097d91205b}} 
\index{mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}!Forward@{Forward}}
\index{Forward@{Forward}!mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}}
\subsubsection{Forward()}
{\footnotesize\ttfamily void Forward (\begin{DoxyParamCaption}\item[{const Input\+Type \&}]{input,  }\item[{Output\+Type \&}]{output }\end{DoxyParamCaption})}



Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activity forward through f. 

Works only for 2D Tensors.


\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_1CReLU_a0ee21c2a36e5abad1e7a9d5dd00849f9}} 
\index{mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}}
\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 82 of file c\+\_\+relu.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1CReLU_a21d5f745f02c709625a4ee0907f004a5}} 
\index{mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}}
\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 84 of file c\+\_\+relu.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1CReLU_aa5b3dd8336182f751ebec27167c22415}} 
\index{mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::ann\+::\+C\+Re\+LU@{mlpack\+::ann\+::\+C\+Re\+LU}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})}



Serialize the layer. 



Referenced by C\+Re\+L\+U$<$ Input\+Data\+Type, Output\+Data\+Type $>$\+::\+Delta().



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/var/www/mlpack.\+ratml.\+org/mlpack.\+org/\+\_\+src/mlpack-\/3.\+3.\+2/src/mlpack/methods/ann/layer/\textbf{ c\+\_\+relu.\+hpp}\end{DoxyCompactItemize}
