\hypertarget{classnntrainer_1_1RandomDataOneHotProducer}{}\doxysection{nntrainer\+::Random\+Data\+One\+Hot\+Producer Class Reference}
\label{classnntrainer_1_1RandomDataOneHotProducer}\index{nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}}


Random\+Data\+Producer which generates a onehot vector as a label.  




{\ttfamily \#include $<$random\+\_\+data\+\_\+producers.\+h$>$}



Inheritance diagram for nntrainer\+::Random\+Data\+One\+Hot\+Producer\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=230pt]{classnntrainer_1_1RandomDataOneHotProducer__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for nntrainer\+::Random\+Data\+One\+Hot\+Producer\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=230pt]{classnntrainer_1_1RandomDataOneHotProducer__coll__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classnntrainer_1_1RandomDataOneHotProducer_ac54cb56c606e010f688aac78d589275c}{Random\+Data\+One\+Hot\+Producer}} ()
\begin{DoxyCompactList}\small\item\em Construct a new Random Data One Hot Producer object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classnntrainer_1_1RandomDataOneHotProducer_aab8631f0c4b8ce76a9bac524ca90f957}{$\sim$\+Random\+Data\+One\+Hot\+Producer}} ()
\begin{DoxyCompactList}\small\item\em Destroy the Random Data One Hot Producer object. \end{DoxyCompactList}\item 
const std\+::string \mbox{\hyperlink{classnntrainer_1_1RandomDataOneHotProducer_a5c731c79719aaf5f9caa3951e4f02eb0}{get\+Type}} () const override
\begin{DoxyCompactList}\small\item\em Get the producer type. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RandomDataOneHotProducer_a1258d8dc1bc034a127f3273b455bee98}{is\+Multi\+Thread\+Safe}} () const override
\begin{DoxyCompactList}\small\item\em denote if given producer is thread safe and can be parallelized. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classnntrainer_1_1RandomDataOneHotProducer_af816e4886e14207f4d4be3037b395174}{set\+Property}} (const std\+::vector$<$ std\+::string $>$ \&properties) override
\item 
\mbox{\hyperlink{classnntrainer_1_1DataProducer_a68a584a2abd402afb289fb79dc79426f}{Data\+Producer\+::\+Generator}} \mbox{\hyperlink{classnntrainer_1_1RandomDataOneHotProducer_a5bb09f729be6f57a5a37951a12156e5c}{finalize}} (const std\+::vector$<$ Tensor\+Dim $>$ \&input\+\_\+dims, const std\+::vector$<$ Tensor\+Dim $>$ \&label\+\_\+dims, void $\ast$user\+\_\+data=nullptr) override
\item 
unsigned int \mbox{\hyperlink{classnntrainer_1_1RandomDataOneHotProducer_a6dc94b96565f1e7d2e429ff3305f22b1}{size}} (const std\+::vector$<$ Tensor\+Dim $>$ \&input\+\_\+dims, const std\+::vector$<$ Tensor\+Dim $>$ \&label\+\_\+dims) const override
\end{DoxyCompactItemize}
\doxysubsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classnntrainer_1_1RandomDataOneHotProducer_ab05941ca66549a7295e731c56b1c686c}\label{classnntrainer_1_1RandomDataOneHotProducer_ab05941ca66549a7295e731c56b1c686c}} 
static const std\+::string {\bfseries type} = \char`\"{}random\+\_\+data\+\_\+one\+\_\+hot\char`\"{}
\end{DoxyCompactItemize}
\doxysubsection*{Additional Inherited Members}


\doxysubsection{Detailed Description}
Random\+Data\+Producer which generates a onehot vector as a label. 



Definition at line 33 of file random\+\_\+data\+\_\+producers.\+h.



\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classnntrainer_1_1RandomDataOneHotProducer_ac54cb56c606e010f688aac78d589275c}\label{classnntrainer_1_1RandomDataOneHotProducer_ac54cb56c606e010f688aac78d589275c}} 
\index{nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}!RandomDataOneHotProducer@{RandomDataOneHotProducer}}
\index{RandomDataOneHotProducer@{RandomDataOneHotProducer}!nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}}
\doxysubsubsection{\texorpdfstring{RandomDataOneHotProducer()}{RandomDataOneHotProducer()}}
{\footnotesize\ttfamily nntrainer\+::\+Random\+Data\+One\+Hot\+Producer\+::\+Random\+Data\+One\+Hot\+Producer (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Construct a new Random Data One Hot Producer object. 



Definition at line 72 of file random\+\_\+data\+\_\+producers.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1RandomDataOneHotProducer_aab8631f0c4b8ce76a9bac524ca90f957}\label{classnntrainer_1_1RandomDataOneHotProducer_aab8631f0c4b8ce76a9bac524ca90f957}} 
\index{nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}!````~RandomDataOneHotProducer@{$\sim$RandomDataOneHotProducer}}
\index{````~RandomDataOneHotProducer@{$\sim$RandomDataOneHotProducer}!nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}}
\doxysubsubsection{\texorpdfstring{$\sim$RandomDataOneHotProducer()}{~RandomDataOneHotProducer()}}
{\footnotesize\ttfamily nntrainer\+::\+Random\+Data\+One\+Hot\+Producer\+::$\sim$\+Random\+Data\+One\+Hot\+Producer (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Destroy the Random Data One Hot Producer object. 



Definition at line 75 of file random\+\_\+data\+\_\+producers.\+cpp.



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classnntrainer_1_1RandomDataOneHotProducer_a5bb09f729be6f57a5a37951a12156e5c}\label{classnntrainer_1_1RandomDataOneHotProducer_a5bb09f729be6f57a5a37951a12156e5c}} 
\index{nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}!finalize@{finalize}}
\index{finalize@{finalize}!nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}}
\doxysubsubsection{\texorpdfstring{finalize()}{finalize()}}
{\footnotesize\ttfamily \mbox{\hyperlink{classnntrainer_1_1DataProducer_a68a584a2abd402afb289fb79dc79426f}{Data\+Producer\+::\+Generator}} nntrainer\+::\+Random\+Data\+One\+Hot\+Producer\+::finalize (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ Tensor\+Dim $>$ \&}]{input\+\_\+dims,  }\item[{const std\+::vector$<$ Tensor\+Dim $>$ \&}]{label\+\_\+dims,  }\item[{void $\ast$}]{user\+\_\+data = {\ttfamily nullptr} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}





check if the given producer is ready to finalize

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000034}{Todo}}]expand this to non onehot case \end{DoxyRefDesc}


\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000035}{Todo}}]move this to higher order component \end{DoxyRefDesc}


prepare states for the generator

\mbox{\hyperlink{classnntrainer_1_1DataProducer_a68a584a2abd402afb289fb79dc79426f}{Data\+Producer\+::\+Generator}}

Reimplemented from \mbox{\hyperlink{classnntrainer_1_1DataProducer_aa6443d25036ccb3e85b284ca51022291}{nntrainer\+::\+Data\+Producer}}.



Definition at line 94 of file random\+\_\+data\+\_\+producers.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1RandomDataOneHotProducer_a5c731c79719aaf5f9caa3951e4f02eb0}\label{classnntrainer_1_1RandomDataOneHotProducer_a5c731c79719aaf5f9caa3951e4f02eb0}} 
\index{nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}!getType@{getType}}
\index{getType@{getType}!nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}}
\doxysubsubsection{\texorpdfstring{getType()}{getType()}}
{\footnotesize\ttfamily const std\+::string nntrainer\+::\+Random\+Data\+One\+Hot\+Producer\+::get\+Type (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}



Get the producer type. 

\begin{DoxyReturn}{Returns}
const std\+::string type representation 
\end{DoxyReturn}


Implements \mbox{\hyperlink{classnntrainer_1_1DataProducer_aa3f081fc338b4dbf18c6639a1b12daeb}{nntrainer\+::\+Data\+Producer}}.



Definition at line 77 of file random\+\_\+data\+\_\+producers.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1RandomDataOneHotProducer_a1258d8dc1bc034a127f3273b455bee98}\label{classnntrainer_1_1RandomDataOneHotProducer_a1258d8dc1bc034a127f3273b455bee98}} 
\index{nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}!isMultiThreadSafe@{isMultiThreadSafe}}
\index{isMultiThreadSafe@{isMultiThreadSafe}!nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}}
\doxysubsubsection{\texorpdfstring{isMultiThreadSafe()}{isMultiThreadSafe()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Random\+Data\+One\+Hot\+Producer\+::is\+Multi\+Thread\+Safe (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}



denote if given producer is thread safe and can be parallelized. 

\begin{DoxyNote}{Note}
if \mbox{\hyperlink{classnntrainer_1_1RandomDataOneHotProducer_a6dc94b96565f1e7d2e429ff3305f22b1}{size()}} == S\+I\+Z\+E\+\_\+\+U\+N\+D\+E\+F\+I\+E\+ND, thread safe shall be false
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
bool true if thread safe. 
\end{DoxyReturn}
\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000033}{Todo}}]make this true, it is needed to test multiple worker scenario \end{DoxyRefDesc}


Reimplemented from \mbox{\hyperlink{classnntrainer_1_1DataProducer_a5411b64f5ff26d50a13638a0e5f53a29}{nntrainer\+::\+Data\+Producer}}.



Definition at line 81 of file random\+\_\+data\+\_\+producers.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1RandomDataOneHotProducer_af816e4886e14207f4d4be3037b395174}\label{classnntrainer_1_1RandomDataOneHotProducer_af816e4886e14207f4d4be3037b395174}} 
\index{nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}!setProperty@{setProperty}}
\index{setProperty@{setProperty}!nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}}
\doxysubsubsection{\texorpdfstring{setProperty()}{setProperty()}}
{\footnotesize\ttfamily void nntrainer\+::\+Random\+Data\+One\+Hot\+Producer\+::set\+Property (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ std\+::string $>$ \&}]{properties }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}







Reimplemented from \mbox{\hyperlink{classnntrainer_1_1DataProducer_adec84ff25c17552145cc8b3af842749d}{nntrainer\+::\+Data\+Producer}}.



Definition at line 86 of file random\+\_\+data\+\_\+producers.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1RandomDataOneHotProducer_af816e4886e14207f4d4be3037b395174_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RandomDataOneHotProducer_a6dc94b96565f1e7d2e429ff3305f22b1}\label{classnntrainer_1_1RandomDataOneHotProducer_a6dc94b96565f1e7d2e429ff3305f22b1}} 
\index{nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}!size@{size}}
\index{size@{size}!nntrainer::RandomDataOneHotProducer@{nntrainer::RandomDataOneHotProducer}}
\doxysubsubsection{\texorpdfstring{size()}{size()}}
{\footnotesize\ttfamily unsigned int nntrainer\+::\+Random\+Data\+One\+Hot\+Producer\+::size (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ Tensor\+Dim $>$ \&}]{input\+\_\+dims,  }\item[{const std\+::vector$<$ Tensor\+Dim $>$ \&}]{label\+\_\+dims }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}







Reimplemented from \mbox{\hyperlink{classnntrainer_1_1DataProducer_aeab0bfee2f7d741e7317716fcf43f00b}{nntrainer\+::\+Data\+Producer}}.



Definition at line 155 of file random\+\_\+data\+\_\+producers.\+cpp.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
dataset/\mbox{\hyperlink{random__data__producers_8h}{random\+\_\+data\+\_\+producers.\+h}}\item 
dataset/\mbox{\hyperlink{random__data__producers_8cpp}{random\+\_\+data\+\_\+producers.\+cpp}}\end{DoxyCompactItemize}
