class_docstr: Stochastic gradient descent optimizer with Adam
  
  Note: All default values are from the original Adam paper
  
  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
  
  beta_1 : float, optional, default 0.9
      Exponential decay rate for estimates of first moment vector, should be
      in [0, 1)
  
  beta_2 : float, optional, default 0.999
      Exponential decay rate for estimates of second moment vector, should be
      in [0, 1)
  
  epsilon : float, optional, default 1e-8
      Value for numerical stability
  
  Attributes
  ----------
  learning_rate : float
      The current learning rate
  
  t : int
      Timestep
  
  ms : list, length = len(params)
      First moment vectors
  
  vs : list, length = len(params)
      Second moment vectors
  
  References
  ----------
  Kingma, Diederik, and Jimmy Ba.
  "Adam: A method for stochastic optimization."
  arXiv preprint arXiv:1412.6980 (2014).
class_docstr_tok: ["Stochastic","gradient","descent","optimizer","with","Adam","Note",":","All","default","values","are","from","the","original","Adam","paper","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","beta_1",":","float",",","optional",",","default","0.9","Exponential","decay","rate","for","estimates","of","first","moment","vector",",","should","be","in","[","0",",","1",")","beta_2",":","float",",","optional",",","default","0.999","Exponential","decay","rate","for","estimates","of","second","moment","vector",",","should","be","in","[","0",",","1",")","epsilon",":","float",",","optional",",","default","1e-8","Value","for","numerical","stability","Attributes","--","--","--","--","--","learning_rate",":","float","The","current","learning","rate","t",":","int","Timestep","ms",":","list",",","length","=","len","(","params",")","First","moment","vectors","vs",":","list",",","length","=","len","(","params",")","Second","moment","vectors","References","--","--","--","--","--","Kingma",",","Diederik",",","and","Jimmy","Ba",".","``","Adam",":","A","method","for","stochastic","optimization",".","''","arXiv","preprint","arXiv:1412.6980","(","2014",")","."]
docstr: Get the values used to update params with given gradients
  
  Parameters
  ----------
  grads : list, length = len(coefs_) + len(intercepts_)
      Containing gradients with respect to coefs_ and intercepts_ in MLP
      model. So length should be aligned with params
  
  Returns
  -------
  updates : list, length = len(grads)
      The values to add to params
docstr_tok: ["Get","the","values","used","to","update","params","with","given","gradients","Parameters","--","--","--","--","--","grads",":","list",",","length","=","len","(","coefs_",")","+","len","(","intercepts_",")","Containing","gradients","with","respect","to","coefs_","and","intercepts_","in","MLP","model",".","So","length","should","be","aligned","with","params","Returns","--","--","--","-","updates",":","list",",","length","=","len","(","grads",")","The","values","to","add","to","params"]
code: def _get_updates(self, grads):
      """Get the values used to update params with given gradients
  
      Parameters
      ----------
      grads : list, length = len(coefs_) + len(intercepts_)
          Containing gradients with respect to coefs_ and intercepts_ in MLP
          model. So length should be aligned with params
  
      Returns
      -------
      updates : list, length = len(grads)
          The values to add to params
      """
      self.t += 1
      self.ms = [
          self.beta_1 * m + (1 - self.beta_1) * grad
          for m, grad in zip(self.ms, grads)
      ]
      self.vs = [
          self.beta_2 * v + (1 - self.beta_2) * (grad**2)
          for v, grad in zip(self.vs, grads)
      ]
      self.learning_rate = (
          self.learning_rate_init
          * np.sqrt(1 - self.beta_2**self.t)
          / (1 - self.beta_1**self.t)
      )
      updates = [
          -self.learning_rate * m / (np.sqrt(v) + self.epsilon)
          for m, v in zip(self.ms, self.vs)
      ]
      return updates
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/neural_network/_stochastic_optimizers.py
imports: import numpy
label_desc: Use image node_id 2 for calling the AdamOptimizer obj's underlying member method code with example usage: obj._get_updates(grads) and returns: updates