\section{Soft\+Margin\+Loss$<$ Input\+Data\+Type, Output\+Data\+Type $>$ Class Template Reference}
\label{classmlpack_1_1ann_1_1SoftMarginLoss}\index{Soft\+Margin\+Loss$<$ Input\+Data\+Type, Output\+Data\+Type $>$@{Soft\+Margin\+Loss$<$ Input\+Data\+Type, Output\+Data\+Type $>$}}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Soft\+Margin\+Loss} (const bool reduction=true)
\begin{DoxyCompactList}\small\item\em Create the \doxyref{Soft\+Margin\+Loss}{p.}{classmlpack_1_1ann_1_1SoftMarginLoss} 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 
{\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 Soft Margin Loss function. \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 
bool \textbf{ Reduction} () const
\begin{DoxyCompactList}\small\item\em Get the type of reduction used. \end{DoxyCompactList}\item 
bool \& \textbf{ Reduction} ()
\begin{DoxyCompactList}\small\item\em Modify the type of reduction used. \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\+::\+Soft\+Margin\+Loss$<$ Input\+Data\+Type, Output\+Data\+Type $>$}


\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 34 of file soft\+\_\+margin\+\_\+loss.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1ann_1_1SoftMarginLoss_ad9b5a32d621cdb719e2d76be548b298e}} 
\index{mlpack\+::ann\+::\+Soft\+Margin\+Loss@{mlpack\+::ann\+::\+Soft\+Margin\+Loss}!Soft\+Margin\+Loss@{Soft\+Margin\+Loss}}
\index{Soft\+Margin\+Loss@{Soft\+Margin\+Loss}!mlpack\+::ann\+::\+Soft\+Margin\+Loss@{mlpack\+::ann\+::\+Soft\+Margin\+Loss}}
\subsubsection{Soft\+Margin\+Loss()}
{\footnotesize\ttfamily \textbf{ Soft\+Margin\+Loss} (\begin{DoxyParamCaption}\item[{const bool}]{reduction = {\ttfamily true} }\end{DoxyParamCaption})}



Create the \doxyref{Soft\+Margin\+Loss}{p.}{classmlpack_1_1ann_1_1SoftMarginLoss} object. 


\begin{DoxyParams}{Parameters}
{\em reduction} & Specifies the reduction to apply to the output. If false, \textquotesingle{}mean\textquotesingle{} reduction is used, where sum of the output will be divided by the number of elements in the output. If true, \textquotesingle{}sum\textquotesingle{} reduction is used and the output will be summed. It is set to true by default. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1ann_1_1SoftMarginLoss_a7a5e88245fe9cf5644f846902393e97a}} 
\index{mlpack\+::ann\+::\+Soft\+Margin\+Loss@{mlpack\+::ann\+::\+Soft\+Margin\+Loss}!Backward@{Backward}}
\index{Backward@{Backward}!mlpack\+::ann\+::\+Soft\+Margin\+Loss@{mlpack\+::ann\+::\+Soft\+Margin\+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_1SoftMarginLoss_aad9536a75d4ecfe220d313adc47f38fa}} 
\index{mlpack\+::ann\+::\+Soft\+Margin\+Loss@{mlpack\+::ann\+::\+Soft\+Margin\+Loss}!Forward@{Forward}}
\index{Forward@{Forward}!mlpack\+::ann\+::\+Soft\+Margin\+Loss@{mlpack\+::ann\+::\+Soft\+Margin\+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 Soft Margin Loss function. 


\begin{DoxyParams}{Parameters}
{\em input} & Input data used for evaluating the specified function. \\
\hline
{\em target} & The target vector with same shape as input. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1ann_1_1SoftMarginLoss_a8bae962cc603d1cab8d80ec78f8d505d}} 
\index{mlpack\+::ann\+::\+Soft\+Margin\+Loss@{mlpack\+::ann\+::\+Soft\+Margin\+Loss}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+Soft\+Margin\+Loss@{mlpack\+::ann\+::\+Soft\+Margin\+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 soft\+\_\+margin\+\_\+loss.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1SoftMarginLoss_a21d5f745f02c709625a4ee0907f004a5}} 
\index{mlpack\+::ann\+::\+Soft\+Margin\+Loss@{mlpack\+::ann\+::\+Soft\+Margin\+Loss}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+Soft\+Margin\+Loss@{mlpack\+::ann\+::\+Soft\+Margin\+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 soft\+\_\+margin\+\_\+loss.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1SoftMarginLoss_afb1123035456ff8aa73e7f7c08e6acbc}} 
\index{mlpack\+::ann\+::\+Soft\+Margin\+Loss@{mlpack\+::ann\+::\+Soft\+Margin\+Loss}!Reduction@{Reduction}}
\index{Reduction@{Reduction}!mlpack\+::ann\+::\+Soft\+Margin\+Loss@{mlpack\+::ann\+::\+Soft\+Margin\+Loss}}
\subsubsection{Reduction()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily bool Reduction (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the type of reduction used. 



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

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



Modify the type of reduction used. 



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



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

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



Serialize the layer. 



Referenced by Soft\+Margin\+Loss$<$ Input\+Data\+Type, Output\+Data\+Type $>$\+::\+Reduction().



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/var/www/mlpack.\+ratml.\+org/mlpack.\+org/\+\_\+src/mlpack-\/git/src/mlpack/methods/ann/loss\+\_\+functions/\textbf{ soft\+\_\+margin\+\_\+loss.\+hpp}\end{DoxyCompactItemize}
