class_docstr: Adam optimizer.
  
  The Adam optimizer combines features from RMSprop and Adagrad. We
  accumulate both the first and second moments of the gradient with decay
  rates :math:`\beta_1` and :math:`\beta_2` corresponding to window sizes of
  :math:`1/\beta_1` and :math:`1/\beta_2`, respectively.
  
  .. math::
      m' &= \beta_1 m + (1-\beta_1) \nabla J
  
  .. math::
      v' &= \beta_2 v + (1-\beta_2) (\nabla J)^2
  
  We update the parameters by the ratio of the two moments:
  
  .. math::
      \theta = \theta - \alpha \frac{\hat{m}'}{\sqrt{\hat{v}'}+\epsilon}
  
  where we compute the bias-corrected moments :math:`\hat{m}'` and :math:`\hat{v}'` via
  
  .. math::
      \hat{m}' &= m'/(1-\beta_1^t)
  
  .. math::
      \hat{v}' &= v'/(1-\beta_1^t)
  
  Example usage:
  
  .. code-block:: python
  
      from neon.optimizers import Adam
  
      # use Adam
      optimizer = Adam(learning_rate=0.001, beta_1=0.9, beta_2=0.999)
class_docstr_tok: ["Adam","optimizer",".","The","Adam","optimizer","combines","features","from","RMSprop","and","Adagrad",".","We","accumulate","both","the","first","and","second","moments","of","the","gradient","with","decay","rates",":","math",":","`","\\beta_1","`","and",":","math",":","`","\\beta_2","`","corresponding","to","window","sizes","of",":","math",":","`","1\/\\beta_1","`","and",":","math",":","`","1\/\\beta_2","`",",","respectively",".","..","math",":",":","m","'","&","=","\\beta_1","m","+","(","1-\\beta_1",")","\\nabla","J","..","math",":",":","v","'","&","=","\\beta_2","v","+","(","1-\\beta_2",")","(","\\nabla","J",")","^2","We","update","the","parameters","by","the","ratio","of","the","two","moments",":","..","math",":",":","\\theta","=","\\theta","-","\\alpha","\\frac","{","\\hat","{","m","}","'","}","{","\\sqrt","{","\\hat","{","v","}","'","}","+\\epsilon","}","where","we","compute","the","bias-corrected","moments",":","math",":","`","\\hat","{","m","}","'","`","and",":","math",":","`","\\hat","{","v","}","'","`","via","..","math",":",":","\\hat","{","m","}","'","&","=","m'\/","(","1-\\beta_1^t",")","..","math",":",":","\\hat","{","v","}","'","&","=","v'\/","(","1-\\beta_1^t",")","Example","usage",":","..","code-block",":",":","python","from","neon.optimizers","import","Adam","#","use","Adam","optimizer","=","Adam","(","learning_rate=0.001",",","beta_1=0.9",",","beta_2=0.999",")"]
docstr: Class constructor.
  
  Args:
      stochastic_round (bool): Set this to True for stochastic rounding.
                               If False rounding will be to nearest.
                               If True will perform stochastic rounding using default width.
                               Only affects the gpu backend.
      learning_rate (float): the multiplicative coefficient of updates
      beta_1 (float): Adam parameter beta1
      beta_2 (float): Adam parameter beta2
      epsilon (float): numerical stability parameter
      gradient_clip_norm (float, optional): Target gradient norm.
                                            Defaults to None.
      gradient_clip_value (float, optional): Value to element-wise clip gradients.
                                             Defaults to None.
      param_clip_value (float, optional): Value to element-wise clip parameters.
                                          Defaults to None.
docstr_tok: ["Class","constructor",".","Args",":","stochastic_round","(","bool",")",":","Set","this","to","True","for","stochastic","rounding",".","If","False","rounding","will","be","to","nearest",".","If","True","will","perform","stochastic","rounding","using","default","width",".","Only","affects","the","gpu","backend",".","learning_rate","(","float",")",":","the","multiplicative","coefficient","of","updates","beta_1","(","float",")",":","Adam","parameter","beta1","beta_2","(","float",")",":","Adam","parameter","beta2","epsilon","(","float",")",":","numerical","stability","parameter","gradient_clip_norm","(","float",",","optional",")",":","Target","gradient","norm",".","Defaults","to","None",".","gradient_clip_value","(","float",",","optional",")",":","Value","to","element-wise","clip","gradients",".","Defaults","to","None",".","param_clip_value","(","float",",","optional",")",":","Value","to","element-wise","clip","parameters",".","Defaults","to","None","."]
code: def __init__(
      self,
      stochastic_round=False,
      learning_rate=0.001,
      beta_1=0.9,
      beta_2=0.999,
      epsilon=1e-8,
      gradient_clip_norm=None,
      gradient_clip_value=None,
      param_clip_value=None,
      name="adam",
  ):
      """
      Class constructor.
  
      Args:
          stochastic_round (bool): Set this to True for stochastic rounding.
                                   If False rounding will be to nearest.
                                   If True will perform stochastic rounding using default width.
                                   Only affects the gpu backend.
          learning_rate (float): the multiplicative coefficient of updates
          beta_1 (float): Adam parameter beta1
          beta_2 (float): Adam parameter beta2
          epsilon (float): numerical stability parameter
          gradient_clip_norm (float, optional): Target gradient norm.
                                                Defaults to None.
          gradient_clip_value (float, optional): Value to element-wise clip gradients.
                                                 Defaults to None.
          param_clip_value (float, optional): Value to element-wise clip parameters.
                                              Defaults to None.
      """
      super(Adam, self).__init__(name=name)
      self.beta_1 = beta_1
      self.beta_2 = beta_2
      self.epsilon = epsilon
      self.learning_rate = learning_rate
      self.stochastic_round = stochastic_round
      self.gradient_clip_norm = gradient_clip_norm
      self.gradient_clip_value = gradient_clip_value
      self.param_clip_value = param_clip_value
      self.t = 0
  
imports: from __future__ import division
  from neon import NervanaObject
  from neon.util.persist import load_class
  import logging
  import numpy
label_desc: Use image node_id 1 to create a new Adam object from inherited base classes: Optimizer with example: obj = Adam(stochastic_round, learning_rate, beta_1, beta_2, epsilon, gradient_clip_norm, gradient_clip_value, param_clip_value, name)