class_docstr: ```
  Tracks (and plots) the change in loss of a Keras model as learning rate is gradually increased.
  Used to visually identify a good learning rate, given model and data.
  Reference:
      Original Paper: https://arxiv.org/abs/1506.01186
  ```
class_docstr_tok: ["``","`","Tracks","(","and","plots",")","the","change","in","loss","of","a","Keras","model","as","learning","rate","is","gradually","increased",".","Used","to","visually","identify","a","good","learning","rate",",","given","model","and","data",".","Reference",":","Original","Paper",":","https",":","\/\/arxiv.org\/abs\/1506.01186","``","`"]
docstr: ```
  Plots rate of change of the loss function.
  Parameters:
      sma - number of batches for simple moving average to smooth out the curve.
      n_skip_beginning - number of batches to skip on the left.
      n_skip_end - number of batches to skip on the right.
      y_lim - limits for the y axis.
  ```
docstr_tok: ["``","`","Plots","rate","of","change","of","the","loss","function",".","Parameters",":","sma","-","number","of","batches","for","simple","moving","average","to","smooth","out","the","curve",".","n_skip_beginning","-","number","of","batches","to","skip","on","the","left",".","n_skip_end","-","number","of","batches","to","skip","on","the","right",".","y_lim","-","limits","for","the","y","axis",".","``","`"]
code: def plot_loss_change(
      self,
      sma=1,
      n_skip_beginning=10,
      n_skip_end=5,
      y_lim=(-0.01, 0.01),
  ):
      """
      ```
      Plots rate of change of the loss function.
      Parameters:
          sma - number of batches for simple moving average to smooth out the curve.
          n_skip_beginning - number of batches to skip on the left.
          n_skip_end - number of batches to skip on the right.
          y_lim - limits for the y axis.
      ```
      """
      assert sma >= 1
      derivatives = [0] * sma
      for i in range(sma, len(self.lrs)):
          derivative = (self.losses[i] - self.losses[i - sma]) / sma
          derivatives.append(derivative)
  
      plt.ylabel("rate of loss change")
      plt.xlabel("learning rate (log scale)")
      plt.plot(
          self.lrs[n_skip_beginning:-n_skip_end],
          derivatives[n_skip_beginning:-n_skip_end],
      )
      plt.xscale("log")
      plt.ylim(y_lim)
  
file_path: ktrain/ktrain/lroptimize/lrfinder.py
imports: from ..None import utils
  from ..imports import *
label_desc: Use image node_id 9 for calling the LRFinder obj's underlying member method code with example usage: obj.plot_loss_change(sma, n_skip_beginning, n_skip_end, y_lim) without return types