class_docstr: Stochastic gradient descent optimizer with momentum
  
  Parameters
  ----------
  params : list, length = len(coefs_) + len(intercepts_)
      The concatenated list containing coefs_ and intercepts_ in MLP model.
      Used for initializing velocities and updating params
  
  learning_rate_init : float, optional, default 0.1
      The initial learning rate used. It controls the step-size in updating
      the weights
  
  lr_schedule : {'constant', 'adaptive', 'invscaling'}, default 'constant'
      Learning rate schedule for weight updates.
  
      -'constant', is a constant learning rate given by
       'learning_rate_init'.
  
      -'invscaling' gradually decreases the learning rate 'learning_rate_' at
        each time step 't' using an inverse scaling exponent of 'power_t'.
        learning_rate_ = learning_rate_init / pow(t, power_t)
  
      -'adaptive', keeps the learning rate constant to
       'learning_rate_init' as long as the training keeps decreasing.
       Each time 2 consecutive epochs fail to decrease the training loss by
       tol, or fail to increase validation score by tol if 'early_stopping'
       is on, the current learning rate is divided by 5.
  
  momentum : float, optional, default 0.9
      Value of momentum used, must be larger than or equal to 0
  
  nesterov : bool, optional, default True
      Whether to use nesterov's momentum or not. Use nesterov's if True
  
  Attributes
  ----------
  learning_rate : float
      the current learning rate
  
  velocities : list, length = len(params)
      velocities that are used to update params
class_docstr_tok: ["Stochastic","gradient","descent","optimizer","with","momentum","Parameters","--","--","--","--","--","params",":","list",",","length","=","len","(","coefs_",")","+","len","(","intercepts_",")","The","concatenated","list","containing","coefs_","and","intercepts_","in","MLP","model",".","Used","for","initializing","velocities","and","updating","params","learning_rate_init",":","float",",","optional",",","default","0.1","The","initial","learning","rate","used",".","It","controls","the","step-size","in","updating","the","weights","lr_schedule",":","{","'constant","'",",","'adaptive","'",",","'invscaling","'","}",",","default","'constant'","Learning","rate","schedule","for","weight","updates",".","-'constant","'",",","is","a","constant","learning","rate","given","by","'learning_rate_init","'",".","-'invscaling","'","gradually","decreases","the","learning","rate","'learning_rate_","'","at","each","time","step","'t","'","using","an","inverse","scaling","exponent","of","'power_t","'",".","learning_rate_","=","learning_rate_init","\/","pow","(","t",",","power_t",")","-'adaptive","'",",","keeps","the","learning","rate","constant","to","'learning_rate_init","'","as","long","as","the","training","keeps","decreasing",".","Each","time","2","consecutive","epochs","fail","to","decrease","the","training","loss","by","tol",",","or","fail","to","increase","validation","score","by","tol","if","'early_stopping'","is","on",",","the","current","learning","rate","is","divided","by","5.","momentum",":","float",",","optional",",","default","0.9","Value","of","momentum","used",",","must","be","larger","than","or","equal","to","0","nesterov",":","bool",",","optional",",","default","True","Whether","to","use","nesterov","'s","momentum","or","not",".","Use","nesterov","'s","if","True","Attributes","--","--","--","--","--","learning_rate",":","float","the","current","learning","rate","velocities",":","list",",","length","=","len","(","params",")","velocities","that","are","used","to","update","params"]
code: def trigger_stopping(self, msg, verbose):
      if self.lr_schedule == "adaptive":
          if self.learning_rate > 1e-6:
              self.learning_rate /= 5.0
              if verbose:
                  print(
                      msg
                      + " Setting learning rate to %f"
                      % self.learning_rate
                  )
              return False
          else:
              if verbose:
                  print(msg + " Learning rate too small. Stopping.")
              return True
      else:
          if verbose:
              print(msg + " Stopping.")
          return True
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/neural_network/_stochastic_optimizers.py
imports: import numpy
label_desc: Use image node_id 3 for calling the SGDOptimizer obj's underlying member method code with example usage: obj.trigger_stopping(msg, verbose) and returns: True, False, True