\hypertarget{classnntrainer_1_1RunOptimizerContext}{}\doxysection{nntrainer\+::Run\+Optimizer\+Context Class Reference}
\label{classnntrainer_1_1RunOptimizerContext}\index{nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classnntrainer_1_1RunOptimizerContext_a0795d18c0d22236f5ffcebee79e5239f}{Run\+Optimizer\+Context}} (\mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} $\ast$w=nullptr, size\+\_\+t iter=0, double lr=0.\+0)
\begin{DoxyCompactList}\small\item\em Construct a new Run Optimizer Context object. \end{DoxyCompactList}\item 
Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunOptimizerContext_a0bfb161332d073228b7cc8e984aeb346}{get\+Weight}} () const
\begin{DoxyCompactList}\small\item\em Get the \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} tensor object. \end{DoxyCompactList}\item 
Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunOptimizerContext_a184a26e9df094adfe2cec18fab5db74e}{get\+Gradient}} () const
\begin{DoxyCompactList}\small\item\em Get the \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} Gradient tensor object. \end{DoxyCompactList}\item 
Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunOptimizerContext_aa00155bb8bd16834f5162ea9953b8dc9}{get\+Optimizer\+Variable}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em Get the optimizer variable associated to this weight. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RunOptimizerContext_a5e8e4ad393952ba2e73a339c8286ed17}{ready\+To\+Use}} () const
\begin{DoxyCompactList}\small\item\em Check if run context is set and is ready to use. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classnntrainer_1_1RunOptimizerContext_a9877bc523247d19f47e019619ad56500}{apply\+Gradient}} (double lr) const
\begin{DoxyCompactList}\small\item\em Apply the gradient with the given learning rate. \end{DoxyCompactList}\item 
size\+\_\+t \mbox{\hyperlink{classnntrainer_1_1RunOptimizerContext_aeb4953c626dc83f2db724a1eba546370}{get\+Iteration}} () const
\begin{DoxyCompactList}\small\item\em Get the current iteration value. \end{DoxyCompactList}\item 
double \mbox{\hyperlink{classnntrainer_1_1RunOptimizerContext_a57ec73315b52ba216d29737bfb1a01ed}{get\+Learning\+Rate}} () const
\begin{DoxyCompactList}\small\item\em Get the current iteration value. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


Definition at line 31 of file optimizer\+\_\+context.\+h.



\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classnntrainer_1_1RunOptimizerContext_a0795d18c0d22236f5ffcebee79e5239f}\label{classnntrainer_1_1RunOptimizerContext_a0795d18c0d22236f5ffcebee79e5239f}} 
\index{nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}!RunOptimizerContext@{RunOptimizerContext}}
\index{RunOptimizerContext@{RunOptimizerContext}!nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}}
\doxysubsubsection{\texorpdfstring{RunOptimizerContext()}{RunOptimizerContext()}}
{\footnotesize\ttfamily nntrainer\+::\+Run\+Optimizer\+Context\+::\+Run\+Optimizer\+Context (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} $\ast$}]{w = {\ttfamily nullptr},  }\item[{size\+\_\+t}]{iter = {\ttfamily 0},  }\item[{double}]{lr = {\ttfamily 0.0} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Construct a new Run Optimizer Context object. 



Definition at line 37 of file optimizer\+\_\+context.\+h.



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classnntrainer_1_1RunOptimizerContext_a9877bc523247d19f47e019619ad56500}\label{classnntrainer_1_1RunOptimizerContext_a9877bc523247d19f47e019619ad56500}} 
\index{nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}!applyGradient@{applyGradient}}
\index{applyGradient@{applyGradient}!nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}}
\doxysubsubsection{\texorpdfstring{applyGradient()}{applyGradient()}}
{\footnotesize\ttfamily void nntrainer\+::\+Run\+Optimizer\+Context\+::apply\+Gradient (\begin{DoxyParamCaption}\item[{double}]{lr }\end{DoxyParamCaption}) const}



Apply the gradient with the given learning rate. 


\begin{DoxyParams}{Parameters}
{\em lr} & learning rate \\
\hline
\end{DoxyParams}


Definition at line 42 of file optimizer\+\_\+context.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1RunOptimizerContext_a9877bc523247d19f47e019619ad56500_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunOptimizerContext_a184a26e9df094adfe2cec18fab5db74e}\label{classnntrainer_1_1RunOptimizerContext_a184a26e9df094adfe2cec18fab5db74e}} 
\index{nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}!getGradient@{getGradient}}
\index{getGradient@{getGradient}!nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}}
\doxysubsubsection{\texorpdfstring{getGradient()}{getGradient()}}
{\footnotesize\ttfamily Tensor \& nntrainer\+::\+Run\+Optimizer\+Context\+::get\+Gradient (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}



Get the \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} Gradient tensor object. 

\begin{DoxyReturn}{Returns}
Tensor\& Reference to the weight grad tensor 
\end{DoxyReturn}


Definition at line 28 of file optimizer\+\_\+context.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1RunOptimizerContext_a184a26e9df094adfe2cec18fab5db74e_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunOptimizerContext_aeb4953c626dc83f2db724a1eba546370}\label{classnntrainer_1_1RunOptimizerContext_aeb4953c626dc83f2db724a1eba546370}} 
\index{nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}!getIteration@{getIteration}}
\index{getIteration@{getIteration}!nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}}
\doxysubsubsection{\texorpdfstring{getIteration()}{getIteration()}}
{\footnotesize\ttfamily size\+\_\+t nntrainer\+::\+Run\+Optimizer\+Context\+::get\+Iteration (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the current iteration value. 

\begin{DoxyReturn}{Returns}
iteration value 
\end{DoxyReturn}


Definition at line 83 of file optimizer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1RunOptimizerContext_a57ec73315b52ba216d29737bfb1a01ed}\label{classnntrainer_1_1RunOptimizerContext_a57ec73315b52ba216d29737bfb1a01ed}} 
\index{nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}!getLearningRate@{getLearningRate}}
\index{getLearningRate@{getLearningRate}!nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}}
\doxysubsubsection{\texorpdfstring{getLearningRate()}{getLearningRate()}}
{\footnotesize\ttfamily double nntrainer\+::\+Run\+Optimizer\+Context\+::get\+Learning\+Rate (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the current iteration value. 

\begin{DoxyReturn}{Returns}
iteration value 
\end{DoxyReturn}


Definition at line 90 of file optimizer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1RunOptimizerContext_aa00155bb8bd16834f5162ea9953b8dc9}\label{classnntrainer_1_1RunOptimizerContext_aa00155bb8bd16834f5162ea9953b8dc9}} 
\index{nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}!getOptimizerVariable@{getOptimizerVariable}}
\index{getOptimizerVariable@{getOptimizerVariable}!nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}}
\doxysubsubsection{\texorpdfstring{getOptimizerVariable()}{getOptimizerVariable()}}
{\footnotesize\ttfamily Tensor \& nntrainer\+::\+Run\+Optimizer\+Context\+::get\+Optimizer\+Variable (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



Get the optimizer variable associated to this weight. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the associated weight \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the optimizer variable 
\end{DoxyReturn}


Definition at line 35 of file optimizer\+\_\+context.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1RunOptimizerContext_aa00155bb8bd16834f5162ea9953b8dc9_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunOptimizerContext_a0bfb161332d073228b7cc8e984aeb346}\label{classnntrainer_1_1RunOptimizerContext_a0bfb161332d073228b7cc8e984aeb346}} 
\index{nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}!getWeight@{getWeight}}
\index{getWeight@{getWeight}!nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}}
\doxysubsubsection{\texorpdfstring{getWeight()}{getWeight()}}
{\footnotesize\ttfamily Tensor \& nntrainer\+::\+Run\+Optimizer\+Context\+::get\+Weight (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}



Get the \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} tensor object. 

\begin{DoxyReturn}{Returns}
Tensor\& Reference to the weight tensor 
\end{DoxyReturn}


Definition at line 21 of file optimizer\+\_\+context.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1RunOptimizerContext_a0bfb161332d073228b7cc8e984aeb346_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunOptimizerContext_a5e8e4ad393952ba2e73a339c8286ed17}\label{classnntrainer_1_1RunOptimizerContext_a5e8e4ad393952ba2e73a339c8286ed17}} 
\index{nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}!readyToUse@{readyToUse}}
\index{readyToUse@{readyToUse}!nntrainer::RunOptimizerContext@{nntrainer::RunOptimizerContext}}
\doxysubsubsection{\texorpdfstring{readyToUse()}{readyToUse()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Run\+Optimizer\+Context\+::ready\+To\+Use (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Check if run context is set and is ready to use. 

\begin{DoxyReturn}{Returns}
true if ready, else false 
\end{DoxyReturn}


Definition at line 69 of file optimizer\+\_\+context.\+h.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
optimizers/\mbox{\hyperlink{optimizer__context_8h}{optimizer\+\_\+context.\+h}}\item 
optimizers/optimizer\+\_\+context.\+cpp\end{DoxyCompactItemize}
