\section{Huber\+Loss$<$ Input\+Data\+Type, Output\+Data\+Type $>$ Class Template Reference}
\label{classmlpack_1_1ann_1_1HuberLoss}\index{Huber\+Loss$<$ Input\+Data\+Type, Output\+Data\+Type $>$@{Huber\+Loss$<$ Input\+Data\+Type, Output\+Data\+Type $>$}}


The Huber loss is a loss function used in robust regression, that is less sensitive to outliers in data than the squared error loss.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Huber\+Loss} (const double delta=1.\+0, const bool mean=true)
\begin{DoxyCompactList}\small\item\em Create the \doxyref{Huber\+Loss}{p.}{classmlpack_1_1ann_1_1HuberLoss} 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 
double \textbf{ Delta} () const
\begin{DoxyCompactList}\small\item\em Get the value of delta. \end{DoxyCompactList}\item 
double \& \textbf{ Delta} ()
\begin{DoxyCompactList}\small\item\em Set the value of 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 Huber Loss function. \end{DoxyCompactList}\item 
bool \textbf{ Mean} () const
\begin{DoxyCompactList}\small\item\em Get the value of reduction type. \end{DoxyCompactList}\item 
bool \& \textbf{ Mean} ()
\begin{DoxyCompactList}\small\item\em Set the value of reduction type. \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 \&ar, 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\+::\+Huber\+Loss$<$ Input\+Data\+Type, Output\+Data\+Type $>$}

The Huber loss is a loss function used in robust regression, that is less sensitive to outliers in data than the squared error loss. 

This function is quadratic for small values of $ y - f(x) $, and linear for large values, with equal values and slopes of the different sections at the two points where $ |y - f(x)| = delta $.


\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 36 of file huber\+\_\+loss.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1ann_1_1HuberLoss_af05212ee761a4171dcdd1d0065848bbb}} 
\index{mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}!Huber\+Loss@{Huber\+Loss}}
\index{Huber\+Loss@{Huber\+Loss}!mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}}
\subsubsection{Huber\+Loss()}
{\footnotesize\ttfamily \textbf{ Huber\+Loss} (\begin{DoxyParamCaption}\item[{const double}]{delta = {\ttfamily 1.0},  }\item[{const bool}]{mean = {\ttfamily true} }\end{DoxyParamCaption})}



Create the \doxyref{Huber\+Loss}{p.}{classmlpack_1_1ann_1_1HuberLoss} object. 


\begin{DoxyParams}{Parameters}
{\em delta} & The threshold value upto which squared error is followed and after which absolute error is considered. \\
\hline
{\em mean} & If true then mean loss is computed otherwise sum. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1ann_1_1HuberLoss_a7a5e88245fe9cf5644f846902393e97a}} 
\index{mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}!Backward@{Backward}}
\index{Backward@{Backward}!mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}}
\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. 


\begin{DoxyParams}{Parameters}
{\em input} & The propagated input activation. \\
\hline
{\em target} & The target vector. \\
\hline
{\em output} & The calculated error. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1ann_1_1HuberLoss_acb1f7d73ed8ec9121d6d0e45b560d8fa}} 
\index{mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}!Delta@{Delta}}
\index{Delta@{Delta}!mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}}
\subsubsection{Delta()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily double Delta (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the value of delta. 



Definition at line 76 of file huber\+\_\+loss.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1HuberLoss_a9fcb8a5caa7165245d5aa803b0a94a7c}} 
\index{mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}!Delta@{Delta}}
\index{Delta@{Delta}!mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}}
\subsubsection{Delta()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily double\& Delta (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Set the value of delta. 



Definition at line 78 of file huber\+\_\+loss.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1HuberLoss_aad9536a75d4ecfe220d313adc47f38fa}} 
\index{mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}!Forward@{Forward}}
\index{Forward@{Forward}!mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}}
\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 Huber Loss function. 


\begin{DoxyParams}{Parameters}
{\em input} & Input data used for evaluating the specified function. \\
\hline
{\em target} & The target vector. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1ann_1_1HuberLoss_ab3fece30ee983f7dc98302bacde75efe}} 
\index{mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}!Mean@{Mean}}
\index{Mean@{Mean}!mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}}
\subsubsection{Mean()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily bool Mean (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the value of reduction type. 



Definition at line 81 of file huber\+\_\+loss.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1HuberLoss_ab9d30d78fb30a243c70e8dd27a88bf49}} 
\index{mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}!Mean@{Mean}}
\index{Mean@{Mean}!mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}}
\subsubsection{Mean()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily bool\& Mean (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Set the value of reduction type. 



Definition at line 83 of file huber\+\_\+loss.\+hpp.



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

\mbox{\label{classmlpack_1_1ann_1_1HuberLoss_a8bae962cc603d1cab8d80ec78f8d505d}} 
\index{mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}}
\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 71 of file huber\+\_\+loss.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1HuberLoss_a21d5f745f02c709625a4ee0907f004a5}} 
\index{mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+Huber\+Loss@{mlpack\+::ann\+::\+Huber\+Loss}}
\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 73 of file huber\+\_\+loss.\+hpp.

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



Serialize the layer. 



Referenced by Huber\+Loss$<$ Input\+Data\+Type, Output\+Data\+Type $>$\+::\+Mean().



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{ huber\+\_\+loss.\+hpp}\end{DoxyCompactItemize}
