\section{V\+R\+Class\+Reward$<$ Input\+Data\+Type, Output\+Data\+Type $>$ Class Template Reference}
\label{classmlpack_1_1ann_1_1VRClassReward}\index{V\+R\+Class\+Reward$<$ Input\+Data\+Type, Output\+Data\+Type $>$@{V\+R\+Class\+Reward$<$ Input\+Data\+Type, Output\+Data\+Type $>$}}


Implementation of the variance reduced classification reinforcement layer.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ V\+R\+Class\+Reward} (const double scale=1, const bool size\+Average=true)
\begin{DoxyCompactList}\small\item\em Create the \doxyref{V\+R\+Class\+Reward}{p.}{classmlpack_1_1ann_1_1VRClassReward} object. \end{DoxyCompactList}\item 
{\footnotesize template$<$class Layer\+Type , class... Args$>$ }\\void \textbf{ Add} (Args... args)
\item 
void \textbf{ Add} (\textbf{ Layer\+Types}$<$$>$ layer)
\item 
{\footnotesize template$<$typename Input\+Type , typename Target\+Type , typename Output\+Type $>$ }\\void \textbf{ Backward} (const Input\+Type \&input, const Target\+Type \&target, Output\+Type \&output)
\begin{DoxyCompactList}\small\item\em Ordinary feed backward pass of a neural network. \end{DoxyCompactList}\item 
Output\+Data\+Type \& \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 Target\+Type $>$ }\\double \textbf{ Forward} (const Input\+Type \&input, const Target\+Type \&target)
\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 
std\+::vector$<$ \textbf{ Layer\+Types}$<$$>$ $>$ \& \textbf{ Model} ()
\begin{DoxyCompactList}\small\item\em Get the network modules. \end{DoxyCompactList}\item 
Output\+Data\+Type \& \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{ Scale} () const
\begin{DoxyCompactList}\small\item\em Get the value of scale 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}\item 
bool \textbf{ Size\+Average} () const
\begin{DoxyCompactList}\small\item\em Get the value of parameter size\+Average. \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\+::\+V\+R\+Class\+Reward$<$ Input\+Data\+Type, Output\+Data\+Type $>$}

Implementation of the variance reduced classification reinforcement layer. 

This layer is meant to be used in combination with the reinforce normal layer (Reinforce\+Normal\+Layer), which expects that an reward\+: (1 for success, 0 otherwise).


\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 79 of file layer\+\_\+types.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1ann_1_1VRClassReward_aa16e0d7bec79c3c855df3f5b6ec45af9}} 
\index{mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}!V\+R\+Class\+Reward@{V\+R\+Class\+Reward}}
\index{V\+R\+Class\+Reward@{V\+R\+Class\+Reward}!mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}}
\subsubsection{V\+R\+Class\+Reward()}
{\footnotesize\ttfamily \textbf{ V\+R\+Class\+Reward} (\begin{DoxyParamCaption}\item[{const double}]{scale = {\ttfamily 1},  }\item[{const bool}]{size\+Average = {\ttfamily true} }\end{DoxyParamCaption})}



Create the \doxyref{V\+R\+Class\+Reward}{p.}{classmlpack_1_1ann_1_1VRClassReward} object. 


\begin{DoxyParams}{Parameters}
{\em scale} & Parameter used to scale the reward. \\
\hline
{\em size\+Average} & Take the average over all batches. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1ann_1_1VRClassReward_a8b5234495846c00f6b2c8296ca6bc718}} 
\index{mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}!Add@{Add}}
\index{Add@{Add}!mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}}
\subsubsection{Add()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void \textbf{ Add} (\begin{DoxyParamCaption}\item[{Args...}]{args }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Definition at line 92 of file vr\+\_\+class\+\_\+reward.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1VRClassReward_a1812979d65642be34dd28899d312ce19}} 
\index{mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}!Add@{Add}}
\index{Add@{Add}!mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}}
\subsubsection{Add()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void \textbf{ Add} (\begin{DoxyParamCaption}\item[{\textbf{ Layer\+Types}$<$$>$}]{layer }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Definition at line 99 of file vr\+\_\+class\+\_\+reward.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1VRClassReward_a7a5e88245fe9cf5644f846902393e97a}} 
\index{mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}!Backward@{Backward}}
\index{Backward@{Backward}!mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}}
\subsubsection{Backward()}
{\footnotesize\ttfamily void Backward (\begin{DoxyParamCaption}\item[{const Input\+Type \&}]{input,  }\item[{const Target\+Type \&}]{target,  }\item[{Output\+Type \&}]{output }\end{DoxyParamCaption})}



Ordinary feed backward pass of a neural network. 

The negative log likelihood layer expectes that the input contains log-\/probabilities for each class. The layer also expects a class index, in the range between 1 and the number of classes, as target when calling the Forward function.


\begin{DoxyParams}{Parameters}
{\em input} & The propagated input activation. \\
\hline
{\em target} & The target vector, that contains the class index in the range between 1 and the number of classes. \\
\hline
{\em output} & The calculated error. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1ann_1_1VRClassReward_ae7c8eba5764f021cd93e30efe638e63c}} 
\index{mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}!Delta@{Delta}}
\index{Delta@{Delta}!mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}}
\subsubsection{Delta()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Output\+Data\+Type\& Delta (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the delta. 



Definition at line 82 of file vr\+\_\+class\+\_\+reward.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1VRClassReward_ad6601342d560219ce951d554e69e5e87}} 
\index{mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}!Delta@{Delta}}
\index{Delta@{Delta}!mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}}
\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 84 of file vr\+\_\+class\+\_\+reward.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1VRClassReward_ab29558c4430cc17c1f76f92a470fb17a}} 
\index{mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}!Forward@{Forward}}
\index{Forward@{Forward}!mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}}
\subsubsection{Forward()}
{\footnotesize\ttfamily double Forward (\begin{DoxyParamCaption}\item[{const Input\+Type \&}]{input,  }\item[{const Target\+Type \&}]{target }\end{DoxyParamCaption})}



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 that contains the log-\/probabilities for each class. \\
\hline
{\em target} & The target vector, that contains the class index in the range between 1 and the number of classes. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1ann_1_1VRClassReward_a50c707b4f7c009339d8d661539baf38f}} 
\index{mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}!Model@{Model}}
\index{Model@{Model}!mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}}
\subsubsection{Model()}
{\footnotesize\ttfamily std\+::vector$<$\textbf{ Layer\+Types}$<$$>$ $>$\& Model (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Get the network modules. 



Definition at line 102 of file vr\+\_\+class\+\_\+reward.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1VRClassReward_a8bae962cc603d1cab8d80ec78f8d505d}} 
\index{mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}}
\subsubsection{Output\+Parameter()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Output\+Data\+Type\& Output\+Parameter (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the output parameter. 



Definition at line 77 of file vr\+\_\+class\+\_\+reward.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1VRClassReward_a21d5f745f02c709625a4ee0907f004a5}} 
\index{mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}}
\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 79 of file vr\+\_\+class\+\_\+reward.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1VRClassReward_ab30d1e52df44eb451081926df999fc17}} 
\index{mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}!Scale@{Scale}}
\index{Scale@{Scale}!mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}}
\subsubsection{Scale()}
{\footnotesize\ttfamily double Scale (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the value of scale parameter. 



Definition at line 108 of file vr\+\_\+class\+\_\+reward.\+hpp.



References V\+R\+Class\+Reward$<$ Input\+Data\+Type, Output\+Data\+Type $>$\+::serialize().

\mbox{\label{classmlpack_1_1ann_1_1VRClassReward_aa5b3dd8336182f751ebec27167c22415}} 
\index{mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})}



Serialize the layer. 



Referenced by V\+R\+Class\+Reward$<$ Input\+Data\+Type, Output\+Data\+Type $>$\+::\+Scale().

\mbox{\label{classmlpack_1_1ann_1_1VRClassReward_a58c0528723f288cc6b85412b584fd657}} 
\index{mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}!Size\+Average@{Size\+Average}}
\index{Size\+Average@{Size\+Average}!mlpack\+::ann\+::\+V\+R\+Class\+Reward@{mlpack\+::ann\+::\+V\+R\+Class\+Reward}}
\subsubsection{Size\+Average()}
{\footnotesize\ttfamily bool Size\+Average (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the value of parameter size\+Average. 



Definition at line 105 of file vr\+\_\+class\+\_\+reward.\+hpp.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
/var/www/mlpack.\+ratml.\+org/mlpack.\+org/\+\_\+src/mlpack-\/git/src/mlpack/methods/ann/layer/\textbf{ layer\+\_\+types.\+hpp}\item 
/var/www/mlpack.\+ratml.\+org/mlpack.\+org/\+\_\+src/mlpack-\/git/src/mlpack/methods/ann/layer/\textbf{ vr\+\_\+class\+\_\+reward.\+hpp}\end{DoxyCompactItemize}
