diff --git a/doc/chapters/chapter7.tex b/doc/chapters/chapter7.tex index abf9b9a..3b9756b 100644 --- a/doc/chapters/chapter7.tex +++ b/doc/chapters/chapter7.tex @@ -326,4 +326,32 @@ The steps involved in training a model with \acs{CLR} are as follows : As illustrated in figure \ref{fig:Loss value at 0.2}, in the graph plotted of Loss Vs Learning rate. The model started to learn at learning rate $\epsilon = 0.04$ onwards. We will further reduce the $max\_lr$. + \item In the next experiment, we set the $max\_lr = 0.04$. \\ + Notice in figure \ref{fig:Loss value at 0.04}, there is a plateau until $\epsilon = 0.010$. After which there is a descent until $\epsilon = 0.015$ + \begin{figure}[H] + \centering + \includegraphics[scale=0.9]{loss_004.png} + \caption{Loss vs Learning rate; where $max\_lr = 0.04$} + \label{fig:Loss value at 0.04} + \end{figure} + + \item In the next experiment, we set the $max\_lr = 0.015$. \\ + Notice in figure \ref{fig:Loss value at 0.015}, the loss had not neared zero and the model fails to predict the classification. + \begin{figure}[H] + \centering + \includegraphics[scale=0.9]{loss_0015.png} + \caption{Loss vs Learning rate; where $max\_lr = 0.015$} + \label{fig:Loss value at 0.015} + \end{figure} + + \item From the above experiment we concluded that $max\_lr = 0.02$. works. + Notice in figure \ref{fig:Loss value at 0.015}, the loss had not neared zero and the model fails to predict the classification. + \begin{figure}[H] + \centering + \includegraphics[scale=0.9]{loss_002.png} + \caption{Loss vs Learning rate; where $max\_lr = 0.015$} + \label{fig:Loss value at 0.02} + \end{figure} + + \end{enumerate} \ No newline at end of file diff --git a/doc/images/loss_0015.png b/doc/images/loss_0015.png new file mode 100644 index 0000000..6636e42 Binary files /dev/null and b/doc/images/loss_0015.png differ diff --git a/doc/images/loss_002.png b/doc/images/loss_002.png new file mode 100644 index 0000000..ddba794 Binary files /dev/null and b/doc/images/loss_002.png differ diff --git a/rm_clasificationmodel/TrainClass.py b/rm_clasificationmodel/TrainClass.py index bdba6f5..c81d5ff 100644 --- a/rm_clasificationmodel/TrainClass.py +++ b/rm_clasificationmodel/TrainClass.py @@ -16,7 +16,7 @@ class Train(): self.rnn= RNN(self.inputSize, self.n_hidden, self.n_category) self.lr_low=0.00000000001 - self.lr_max=0.04 + self.lr_max=0.02 self.learning_rate= 0.00000000000001 self.criterion = nn.NLLLoss() @@ -86,7 +86,7 @@ class Train(): for n_iters in batch: - learn_rates=np.linspace(self.lr_low,self.lr_max,total) + learn_rates=np.linspace(self.lr_low,self.lr_max,n_iters) for epoch,lr in zip(range(1, n_iters + 1),learn_rates): self.learning_rate=lr