\hypertarget{classnntrainer_1_1internal_1_1PluggedOptimizer}{}\doxysection{nntrainer\+::internal\+::Plugged\+Optimizer Class Reference}
\label{classnntrainer_1_1internal_1_1PluggedOptimizer}\index{nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}}


Plugged optimizer class.  




{\ttfamily \#include $<$plugged\+\_\+optimizer.\+h$>$}



Inheritance diagram for nntrainer\+::internal\+::Plugged\+Optimizer\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=195pt]{classnntrainer_1_1internal_1_1PluggedOptimizer__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for nntrainer\+::internal\+::Plugged\+Optimizer\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=195pt]{classnntrainer_1_1internal_1_1PluggedOptimizer__coll__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer_a4a3db4a769c4541e7bdd148f32978839}{Plugged\+Optimizer}} (const nntrainer\+::\+Optimizer\+Pluggable $\ast$pluggable)
\begin{DoxyCompactList}\small\item\em Construct a new Plugged Optimizer object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer_ab51c8493a8f6dea0a589c09cb7552138}{$\sim$\+Plugged\+Optimizer}} () override
\begin{DoxyCompactList}\small\item\em Destroy the Plugged Optimizer object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer_a03aa1c1e59ab8e58718f91d322ad8386}{Plugged\+Optimizer}} (\mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer}{Plugged\+Optimizer}} \&\&rhs) noexcept=default
\begin{DoxyCompactList}\small\item\em Move Construct Plugged Optimizer object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer}{Plugged\+Optimizer}} \& \mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer_ae037354613fe074594c172ac27d8a92b}{operator=}} (\mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer}{Plugged\+Optimizer}} \&\&rhs)=default
\begin{DoxyCompactList}\small\item\em Move assign Plugged Optimizer Object. \end{DoxyCompactList}\item 
double \mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer_a985ca093462ef35c9bf901c8884b3ddf}{get\+Default\+Learning\+Rate}} () const override
\item 
void \mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer_a5522b535ec158194a9d2d862a3f36903}{apply\+Gradient}} (\mbox{\hyperlink{classnntrainer_1_1RunOptimizerContext}{Run\+Optimizer\+Context}} \&context) override
\begin{DoxyCompactList}\small\item\em apply gradient to weight \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer_a7c4ab6e5193e957e886e3bffe8875483}{set\+Property}} (const std\+::vector$<$ std\+::string $>$ \&values) override
\begin{DoxyCompactList}\small\item\em set Optimizer Parameters \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classnntrainer_1_1internal_1_1PluggedOptimizer_aa6ede4c11e8b55639d3321cf03cb090a}\label{classnntrainer_1_1internal_1_1PluggedOptimizer_aa6ede4c11e8b55639d3321cf03cb090a}} 
void \mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer_aa6ede4c11e8b55639d3321cf03cb090a}{finalize}} () override
\begin{DoxyCompactList}\small\item\em finalize optimizer. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer_a36a7c41fc3829f261626bc867c637d1f}{read}} (std\+::ifstream \&file) override
\begin{DoxyCompactList}\small\item\em Read Training optimizer parameters from file. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer_af4554f08769347ff987a5dd87411f905}{save}} (std\+::ofstream \&file) override
\begin{DoxyCompactList}\small\item\em Save Training optimizer parameters from file. \end{DoxyCompactList}\item 
virtual std\+::vector$<$ Tensor\+Dim $>$ \mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer_a172ac8a8bd19509e7e1dbbc243888d9b}{get\+Optimizer\+Variable\+Dim}} (const Tensor\+Dim \&dim) override
\begin{DoxyCompactList}\small\item\em Get dimension of extra variables if the optimizer needs any. \end{DoxyCompactList}\item 
const std\+::string \mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer_aa96e5be3ee6a6a1bab2e7c3b25dd8048}{get\+Type}} () const override
\begin{DoxyCompactList}\small\item\em get Optimizer Type \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Plugged optimizer class. 

Definition at line 29 of file plugged\+\_\+optimizer.\+h.



\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classnntrainer_1_1internal_1_1PluggedOptimizer_a4a3db4a769c4541e7bdd148f32978839}\label{classnntrainer_1_1internal_1_1PluggedOptimizer_a4a3db4a769c4541e7bdd148f32978839}} 
\index{nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}!PluggedOptimizer@{PluggedOptimizer}}
\index{PluggedOptimizer@{PluggedOptimizer}!nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}}
\doxysubsubsection{\texorpdfstring{PluggedOptimizer()}{PluggedOptimizer()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily nntrainer\+::internal\+::\+Plugged\+Optimizer\+::\+Plugged\+Optimizer (\begin{DoxyParamCaption}\item[{const nntrainer\+::\+Optimizer\+Pluggable $\ast$}]{pluggable }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Construct a new Plugged Optimizer object. 


\begin{DoxyParams}{Parameters}
{\em pluggable} & Optimizer\+Pluggable structure from the symbol \\
\hline
\end{DoxyParams}


Definition at line 36 of file plugged\+\_\+optimizer.\+h.

\mbox{\Hypertarget{classnntrainer_1_1internal_1_1PluggedOptimizer_ab51c8493a8f6dea0a589c09cb7552138}\label{classnntrainer_1_1internal_1_1PluggedOptimizer_ab51c8493a8f6dea0a589c09cb7552138}} 
\index{nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}!````~PluggedOptimizer@{$\sim$PluggedOptimizer}}
\index{````~PluggedOptimizer@{$\sim$PluggedOptimizer}!nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}}
\doxysubsubsection{\texorpdfstring{$\sim$PluggedOptimizer()}{~PluggedOptimizer()}}
{\footnotesize\ttfamily nntrainer\+::internal\+::\+Plugged\+Optimizer\+::$\sim$\+Plugged\+Optimizer (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [override]}}



Destroy the Plugged Optimizer object. 



Definition at line 48 of file plugged\+\_\+optimizer.\+h.

\mbox{\Hypertarget{classnntrainer_1_1internal_1_1PluggedOptimizer_a03aa1c1e59ab8e58718f91d322ad8386}\label{classnntrainer_1_1internal_1_1PluggedOptimizer_a03aa1c1e59ab8e58718f91d322ad8386}} 
\index{nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}!PluggedOptimizer@{PluggedOptimizer}}
\index{PluggedOptimizer@{PluggedOptimizer}!nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}}
\doxysubsubsection{\texorpdfstring{PluggedOptimizer()}{PluggedOptimizer()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily nntrainer\+::internal\+::\+Plugged\+Optimizer\+::\+Plugged\+Optimizer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer}{Plugged\+Optimizer}} \&\&}]{rhs }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [default]}, {\ttfamily [noexcept]}}



Move Construct Plugged Optimizer object. 


\begin{DoxyParams}{Parameters}
{\em rhs} & optimizer to move \\
\hline
\end{DoxyParams}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classnntrainer_1_1internal_1_1PluggedOptimizer_a5522b535ec158194a9d2d862a3f36903}\label{classnntrainer_1_1internal_1_1PluggedOptimizer_a5522b535ec158194a9d2d862a3f36903}} 
\index{nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}!applyGradient@{applyGradient}}
\index{applyGradient@{applyGradient}!nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}}
\doxysubsubsection{\texorpdfstring{applyGradient()}{applyGradient()}}
{\footnotesize\ttfamily void nntrainer\+::internal\+::\+Plugged\+Optimizer\+::apply\+Gradient (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classnntrainer_1_1RunOptimizerContext}{Run\+Optimizer\+Context}} \&}]{context }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [override]}}



apply gradient to weight 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em context} & Optimizer context \\
\hline
\end{DoxyParams}


Definition at line 76 of file plugged\+\_\+optimizer.\+h.

\mbox{\Hypertarget{classnntrainer_1_1internal_1_1PluggedOptimizer_a985ca093462ef35c9bf901c8884b3ddf}\label{classnntrainer_1_1internal_1_1PluggedOptimizer_a985ca093462ef35c9bf901c8884b3ddf}} 
\index{nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}!getDefaultLearningRate@{getDefaultLearningRate}}
\index{getDefaultLearningRate@{getDefaultLearningRate}!nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}}
\doxysubsubsection{\texorpdfstring{getDefaultLearningRate()}{getDefaultLearningRate()}}
{\footnotesize\ttfamily double nntrainer\+::internal\+::\+Plugged\+Optimizer\+::get\+Default\+Learning\+Rate (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [override]}}







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

\mbox{\Hypertarget{classnntrainer_1_1internal_1_1PluggedOptimizer_a172ac8a8bd19509e7e1dbbc243888d9b}\label{classnntrainer_1_1internal_1_1PluggedOptimizer_a172ac8a8bd19509e7e1dbbc243888d9b}} 
\index{nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}!getOptimizerVariableDim@{getOptimizerVariableDim}}
\index{getOptimizerVariableDim@{getOptimizerVariableDim}!nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}}
\doxysubsubsection{\texorpdfstring{getOptimizerVariableDim()}{getOptimizerVariableDim()}}
{\footnotesize\ttfamily virtual std\+::vector$<$Tensor\+Dim$>$ nntrainer\+::internal\+::\+Plugged\+Optimizer\+::get\+Optimizer\+Variable\+Dim (\begin{DoxyParamCaption}\item[{const Tensor\+Dim \&}]{dim }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Get dimension of extra variables if the optimizer needs any. 


\begin{DoxyParams}{Parameters}
{\em dim} & Dimension of tensor to be added as a optimizer variable \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Vector of dimensions 
\end{DoxyReturn}


Definition at line 113 of file plugged\+\_\+optimizer.\+h.

\mbox{\Hypertarget{classnntrainer_1_1internal_1_1PluggedOptimizer_aa96e5be3ee6a6a1bab2e7c3b25dd8048}\label{classnntrainer_1_1internal_1_1PluggedOptimizer_aa96e5be3ee6a6a1bab2e7c3b25dd8048}} 
\index{nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}!getType@{getType}}
\index{getType@{getType}!nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}}
\doxysubsubsection{\texorpdfstring{getType()}{getType()}}
{\footnotesize\ttfamily const std\+::string nntrainer\+::internal\+::\+Plugged\+Optimizer\+::get\+Type (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [override]}}



get Optimizer Type 


\begin{DoxyRetVals}{Return values}
{\em Optimizer} & type \\
\hline
\end{DoxyRetVals}


Definition at line 121 of file plugged\+\_\+optimizer.\+h.

\mbox{\Hypertarget{classnntrainer_1_1internal_1_1PluggedOptimizer_ae037354613fe074594c172ac27d8a92b}\label{classnntrainer_1_1internal_1_1PluggedOptimizer_ae037354613fe074594c172ac27d8a92b}} 
\index{nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}!operator=@{operator=}}
\index{operator=@{operator=}!nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}}
\doxysubsubsection{\texorpdfstring{operator=()}{operator=()}}
{\footnotesize\ttfamily \mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer}{Plugged\+Optimizer}}\& nntrainer\+::internal\+::\+Plugged\+Optimizer\+::operator= (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer}{Plugged\+Optimizer}} \&\&}]{rhs }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [default]}}



Move assign Plugged Optimizer Object. 


\begin{DoxyParams}{Parameters}
{\em rhs} & optimizer to move \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{classnntrainer_1_1internal_1_1PluggedOptimizer}{Plugged\+Optimizer}}\& $\ast$this 
\end{DoxyReturn}
\mbox{\Hypertarget{classnntrainer_1_1internal_1_1PluggedOptimizer_a36a7c41fc3829f261626bc867c637d1f}\label{classnntrainer_1_1internal_1_1PluggedOptimizer_a36a7c41fc3829f261626bc867c637d1f}} 
\index{nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}!read@{read}}
\index{read@{read}!nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}}
\doxysubsubsection{\texorpdfstring{read()}{read()}}
{\footnotesize\ttfamily void nntrainer\+::internal\+::\+Plugged\+Optimizer\+::read (\begin{DoxyParamCaption}\item[{std\+::ifstream \&}]{file }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [override]}}



Read Training optimizer parameters from file. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em file} & input stream file \\
\hline
\end{DoxyParams}


Definition at line 99 of file plugged\+\_\+optimizer.\+h.

\mbox{\Hypertarget{classnntrainer_1_1internal_1_1PluggedOptimizer_af4554f08769347ff987a5dd87411f905}\label{classnntrainer_1_1internal_1_1PluggedOptimizer_af4554f08769347ff987a5dd87411f905}} 
\index{nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}!save@{save}}
\index{save@{save}!nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}}
\doxysubsubsection{\texorpdfstring{save()}{save()}}
{\footnotesize\ttfamily void nntrainer\+::internal\+::\+Plugged\+Optimizer\+::save (\begin{DoxyParamCaption}\item[{std\+::ofstream \&}]{file }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [override]}}



Save Training optimizer parameters from file. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em file} & output stream file \\
\hline
\end{DoxyParams}


Definition at line 105 of file plugged\+\_\+optimizer.\+h.

\mbox{\Hypertarget{classnntrainer_1_1internal_1_1PluggedOptimizer_a7c4ab6e5193e957e886e3bffe8875483}\label{classnntrainer_1_1internal_1_1PluggedOptimizer_a7c4ab6e5193e957e886e3bffe8875483}} 
\index{nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}!setProperty@{setProperty}}
\index{setProperty@{setProperty}!nntrainer::internal::PluggedOptimizer@{nntrainer::internal::PluggedOptimizer}}
\doxysubsubsection{\texorpdfstring{setProperty()}{setProperty()}}
{\footnotesize\ttfamily void nntrainer\+::internal\+::\+Plugged\+Optimizer\+::set\+Property (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ std\+::string $>$ \&}]{values }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [override]}}



set Optimizer Parameters 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em values} & Optimizer Parameter list \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em \mbox{\hyperlink{nntrainer__error_8h_afa8aa7b8ee0794aff8dcd3029525fc93a1d5fc7f826e7a67851245a3f27b7d0a7}{M\+L\+\_\+\+E\+R\+R\+O\+R\+\_\+\+N\+O\+NE}}} & Successful. \\
\hline
{\em \mbox{\hyperlink{nntrainer__error_8h_afa8aa7b8ee0794aff8dcd3029525fc93a8081833f5d75604414cd5cb831c538ab}{M\+L\+\_\+\+E\+R\+R\+O\+R\+\_\+\+I\+N\+V\+A\+L\+I\+D\+\_\+\+P\+A\+R\+A\+M\+E\+T\+ER}}} & invalid parameter. \\
\hline
\end{DoxyRetVals}


Definition at line 86 of file plugged\+\_\+optimizer.\+h.



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
optimizers/\mbox{\hyperlink{plugged__optimizer_8h}{plugged\+\_\+optimizer.\+h}}\end{DoxyCompactItemize}
