\section{Negative\+Log\+Likelihood$<$ Input\+Data\+Type, Output\+Data\+Type $>$ Class Template Reference}
\label{classmlpack_1_1ann_1_1NegativeLogLikelihood}\index{Negative\+Log\+Likelihood$<$ Input\+Data\+Type, Output\+Data\+Type $>$@{Negative\+Log\+Likelihood$<$ Input\+Data\+Type, Output\+Data\+Type $>$}}


Implementation of the negative log likelihood layer.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Negative\+Log\+Likelihood} ()
\begin{DoxyCompactList}\small\item\em Create the Negative\+Log\+Likelihood\+Layer object. \end{DoxyCompactList}\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 $>$ }\\Input\+Type\+::elem\+\_\+type \textbf{ Forward} (const Input\+Type \&input, const Target\+Type \&target)
\begin{DoxyCompactList}\small\item\em Computes the Negative log likelihood. \end{DoxyCompactList}\item 
Input\+Data\+Type \& \textbf{ Input\+Parameter} () const
\begin{DoxyCompactList}\small\item\em Get the input parameter. \end{DoxyCompactList}\item 
Input\+Data\+Type \& \textbf{ Input\+Parameter} ()
\begin{DoxyCompactList}\small\item\em Modify the input parameter. \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 
{\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\+::\+Negative\+Log\+Likelihood$<$ Input\+Data\+Type, Output\+Data\+Type $>$}

Implementation of the negative log likelihood layer. 

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{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 35 of file negative\+\_\+log\+\_\+likelihood.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1ann_1_1NegativeLogLikelihood_a2c1eb2b08ec47b7097d4100d5241cb14}} 
\index{mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}!Negative\+Log\+Likelihood@{Negative\+Log\+Likelihood}}
\index{Negative\+Log\+Likelihood@{Negative\+Log\+Likelihood}!mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}}
\subsubsection{Negative\+Log\+Likelihood()}
{\footnotesize\ttfamily \textbf{ Negative\+Log\+Likelihood} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Create the Negative\+Log\+Likelihood\+Layer object. 



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1ann_1_1NegativeLogLikelihood_a7a5e88245fe9cf5644f846902393e97a}} 
\index{mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}!Backward@{Backward}}
\index{Backward@{Backward}!mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}}
\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 expects 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_1NegativeLogLikelihood_ae7c8eba5764f021cd93e30efe638e63c}} 
\index{mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}!Delta@{Delta}}
\index{Delta@{Delta}!mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}}
\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 81 of file negative\+\_\+log\+\_\+likelihood.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1NegativeLogLikelihood_ad6601342d560219ce951d554e69e5e87}} 
\index{mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}!Delta@{Delta}}
\index{Delta@{Delta}!mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}}
\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 83 of file negative\+\_\+log\+\_\+likelihood.\+hpp.



References Negative\+Log\+Likelihood$<$ Input\+Data\+Type, Output\+Data\+Type $>$\+::serialize().

\mbox{\label{classmlpack_1_1ann_1_1NegativeLogLikelihood_aad9536a75d4ecfe220d313adc47f38fa}} 
\index{mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}!Forward@{Forward}}
\index{Forward@{Forward}!mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}}
\subsubsection{Forward()}
{\footnotesize\ttfamily Input\+Type\+::elem\+\_\+type Forward (\begin{DoxyParamCaption}\item[{const Input\+Type \&}]{input,  }\item[{const Target\+Type \&}]{target }\end{DoxyParamCaption})}



Computes the Negative log likelihood. 


\begin{DoxyParams}{Parameters}
{\em input} & Input data used for evaluating the specified function. \\
\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_1NegativeLogLikelihood_a1506936601ddae886088d2804623ca4b}} 
\index{mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}!Input\+Parameter@{Input\+Parameter}}
\index{Input\+Parameter@{Input\+Parameter}!mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}}
\subsubsection{Input\+Parameter()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Input\+Data\+Type\& Input\+Parameter (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the input parameter. 



Definition at line 71 of file negative\+\_\+log\+\_\+likelihood.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1NegativeLogLikelihood_a063c3b1053c7979a7dd2e7bbd2bf1f8a}} 
\index{mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}!Input\+Parameter@{Input\+Parameter}}
\index{Input\+Parameter@{Input\+Parameter}!mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}}
\subsubsection{Input\+Parameter()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily Input\+Data\+Type\& Input\+Parameter (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the input parameter. 



Definition at line 73 of file negative\+\_\+log\+\_\+likelihood.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1NegativeLogLikelihood_a8bae962cc603d1cab8d80ec78f8d505d}} 
\index{mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}}
\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 76 of file negative\+\_\+log\+\_\+likelihood.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1NegativeLogLikelihood_a21d5f745f02c709625a4ee0907f004a5}} 
\index{mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}}
\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 78 of file negative\+\_\+log\+\_\+likelihood.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1NegativeLogLikelihood_aa5b3dd8336182f751ebec27167c22415}} 
\index{mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::ann\+::\+Negative\+Log\+Likelihood@{mlpack\+::ann\+::\+Negative\+Log\+Likelihood}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})}



Serialize the layer. 



Referenced by Negative\+Log\+Likelihood$<$ 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.\+0/src/mlpack/methods/ann/loss\+\_\+functions/\textbf{ negative\+\_\+log\+\_\+likelihood.\+hpp}\end{DoxyCompactItemize}
