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


The dice loss performance function measures the network\textquotesingle{}s performance according to the dice coefficient between the input and target distributions.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Dice\+Loss} (const double smooth=1)
\begin{DoxyCompactList}\small\item\em Create the \doxyref{Dice\+Loss}{p.}{classmlpack_1_1ann_1_1DiceLoss} 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 dice 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 
{\footnotesize template$<$typename Archive $>$ }\\void \textbf{ serialize} (Archive \&ar, const unsigned int)
\begin{DoxyCompactList}\small\item\em Serialize the layer. \end{DoxyCompactList}\item 
double \textbf{ Smooth} () const
\begin{DoxyCompactList}\small\item\em Get the smooth. \end{DoxyCompactList}\item 
double \& \textbf{ Smooth} ()
\begin{DoxyCompactList}\small\item\em Modify the smooth. \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\+::\+Dice\+Loss$<$ Input\+Data\+Type, Output\+Data\+Type $>$}

The dice loss performance function measures the network\textquotesingle{}s performance according to the dice coefficient between the input and target distributions. 

For more information see the following.

\{Milletari2016, author = \{Fausto Milletari and Nassir Navab and Seyed\{-\/\}Ahmad Ahmadi\}, title = \{V-\/\+Net\+: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation\}, journal = \{Co\+RR\}, volume = \{abs/1606.\+04797\}, year = \{2016\}, url = \{{\tt http\+://arxiv.\+org/abs/1606.\+04797}\}, archive\+Prefix = \{ar\+Xiv\}, eprint = \{1606.\+04797\}, \}


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



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1ann_1_1DiceLoss_a4bfcd6e91e6a5f7133996d0800ca248f}} 
\index{mlpack\+::ann\+::\+Dice\+Loss@{mlpack\+::ann\+::\+Dice\+Loss}!Dice\+Loss@{Dice\+Loss}}
\index{Dice\+Loss@{Dice\+Loss}!mlpack\+::ann\+::\+Dice\+Loss@{mlpack\+::ann\+::\+Dice\+Loss}}
\subsubsection{Dice\+Loss()}
{\footnotesize\ttfamily \textbf{ Dice\+Loss} (\begin{DoxyParamCaption}\item[{const double}]{smooth = {\ttfamily 1} }\end{DoxyParamCaption})}



Create the \doxyref{Dice\+Loss}{p.}{classmlpack_1_1ann_1_1DiceLoss} object. 


\begin{DoxyParams}{Parameters}
{\em smooth} & The Laplace smoothing parameter. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1ann_1_1DiceLoss_a7a5e88245fe9cf5644f846902393e97a}} 
\index{mlpack\+::ann\+::\+Dice\+Loss@{mlpack\+::ann\+::\+Dice\+Loss}!Backward@{Backward}}
\index{Backward@{Backward}!mlpack\+::ann\+::\+Dice\+Loss@{mlpack\+::ann\+::\+Dice\+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_1DiceLoss_aad9536a75d4ecfe220d313adc47f38fa}} 
\index{mlpack\+::ann\+::\+Dice\+Loss@{mlpack\+::ann\+::\+Dice\+Loss}!Forward@{Forward}}
\index{Forward@{Forward}!mlpack\+::ann\+::\+Dice\+Loss@{mlpack\+::ann\+::\+Dice\+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 dice 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_1DiceLoss_a8bae962cc603d1cab8d80ec78f8d505d}} 
\index{mlpack\+::ann\+::\+Dice\+Loss@{mlpack\+::ann\+::\+Dice\+Loss}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+Dice\+Loss@{mlpack\+::ann\+::\+Dice\+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 81 of file dice\+\_\+loss.\+hpp.

\mbox{\label{classmlpack_1_1ann_1_1DiceLoss_a21d5f745f02c709625a4ee0907f004a5}} 
\index{mlpack\+::ann\+::\+Dice\+Loss@{mlpack\+::ann\+::\+Dice\+Loss}!Output\+Parameter@{Output\+Parameter}}
\index{Output\+Parameter@{Output\+Parameter}!mlpack\+::ann\+::\+Dice\+Loss@{mlpack\+::ann\+::\+Dice\+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 83 of file dice\+\_\+loss.\+hpp.

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



Serialize the layer. 



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

\mbox{\label{classmlpack_1_1ann_1_1DiceLoss_ac72576e4dbe1a49364cb15d8843e4cad}} 
\index{mlpack\+::ann\+::\+Dice\+Loss@{mlpack\+::ann\+::\+Dice\+Loss}!Smooth@{Smooth}}
\index{Smooth@{Smooth}!mlpack\+::ann\+::\+Dice\+Loss@{mlpack\+::ann\+::\+Dice\+Loss}}
\subsubsection{Smooth()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily double Smooth (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the smooth. 



Definition at line 86 of file dice\+\_\+loss.\+hpp.

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



Modify the smooth. 



Definition at line 88 of file dice\+\_\+loss.\+hpp.



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



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.\+1/src/mlpack/methods/ann/loss\+\_\+functions/\textbf{ dice\+\_\+loss.\+hpp}\end{DoxyCompactItemize}
