\section{Base\+Layer$<$ Activation\+Function, Input\+Data\+Type, Output\+Data\+Type $>$ Class Template Reference}
\label{classmlpack_1_1ann_1_1BaseLayer}\index{Base\+Layer$<$ Activation\+Function, Input\+Data\+Type, Output\+Data\+Type $>$@{Base\+Layer$<$ Activation\+Function, Input\+Data\+Type, Output\+Data\+Type $>$}}


Implementation of the base layer.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Base\+Layer} ()
\begin{DoxyCompactList}\small\item\em Create the \doxyref{Base\+Layer}{p.}{classmlpack_1_1ann_1_1BaseLayer} object. \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 a neural network, calculating the function f(x) by propagating x backwards trough 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$<$class Activation\+Function = Logistic\+Function, typename Input\+Data\+Type = arma\+::mat, typename Output\+Data\+Type = arma\+::mat$>$\newline
class mlpack\+::ann\+::\+Base\+Layer$<$ Activation\+Function, Input\+Data\+Type, Output\+Data\+Type $>$}

Implementation of the base layer. 

The base layer works as a metaclass which attaches various functions to the embedding layer.

A few convenience typedefs are given\+:


\begin{DoxyItemize}
\item Sigmoid\+Layer
\item Identity\+Layer
\item Re\+L\+U\+Layer
\item Tan\+H\+Layer
\end{DoxyItemize}


\begin{DoxyTemplParams}{Template Parameters}
{\em Activation\+Function} & Activation function used for the embedding layer. \\
\hline
{\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 53 of file base\+\_\+layer.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1ann_1_1BaseLayer_a5efea921257d23b1d5a755609d7a7943}} 
\index{mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}!Base\+Layer@{Base\+Layer}}
\index{Base\+Layer@{Base\+Layer}!mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}}
\subsubsection{Base\+Layer()}
{\footnotesize\ttfamily \textbf{ Base\+Layer} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Create the \doxyref{Base\+Layer}{p.}{classmlpack_1_1ann_1_1BaseLayer} object. 



Definition at line 59 of file base\+\_\+layer.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1ann_1_1BaseLayer_a78dbad83871f43db1975e45a9a69c376}} 
\index{mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}!Backward@{Backward}}
\index{Backward@{Backward}!mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}}
\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})\hspace{0.3cm}{\ttfamily [inline]}}



Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backwards trough 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}


Definition at line 87 of file base\+\_\+layer.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1BaseLayer_a797f7edb44dd081e5e2b3cc316eef6bd}} 
\index{mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}!Delta@{Delta}}
\index{Delta@{Delta}!mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}}
\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 102 of file base\+\_\+layer.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1BaseLayer_ad6601342d560219ce951d554e69e5e87}} 
\index{mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}!Delta@{Delta}}
\index{Delta@{Delta}!mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}}
\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 104 of file base\+\_\+layer.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1BaseLayer_a09440df0a90bdcc766e56e097d91205b}} 
\index{mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}!Forward@{Forward}}
\index{Forward@{Forward}!mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}}
\subsubsection{Forward()}
{\footnotesize\ttfamily void Forward (\begin{DoxyParamCaption}\item[{const Input\+Type \&}]{input,  }\item[{Output\+Type \&}]{output }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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


\begin{DoxyParams}{Parameters}
{\em input} & Input data used for evaluating the specified function. \\
\hline
{\em output} & Resulting output activation. \\
\hline
\end{DoxyParams}


Definition at line 72 of file base\+\_\+layer.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1BaseLayer_a0ee21c2a36e5abad1e7a9d5dd00849f9}} 
\index{mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}}
\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 97 of file base\+\_\+layer.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1BaseLayer_a21d5f745f02c709625a4ee0907f004a5}} 
\index{mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}}
\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 99 of file base\+\_\+layer.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1BaseLayer_aa5b3dd8336182f751ebec27167c22415}} 
\index{mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::ann\+::\+Base\+Layer@{mlpack\+::ann\+::\+Base\+Layer}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Serialize the layer. 



Definition at line 110 of file base\+\_\+layer.\+hpp.



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.\+0/src/mlpack/methods/ann/layer/\textbf{ base\+\_\+layer.\+hpp}\end{DoxyCompactItemize}
