class_docstr: Adaptive Moment Estimation (Adam) optimizer.
  
  Adam is an algorithm for first-order gradient-based optimization of stochastic
  objective functions, based on adaptive estimates of lower-order moments. See
  :cite:`kingma2014adam` for more details.
  
  Note: default parameter values have been taken from the paper.
  
  Attributes:
    learning_rate: Step size (``alpha`` in the paper).
    beta1: Exponential decay rate for first moment estimate.
    beta2: Exponential decay rate for second moment estimate.
    epsilon: Small value to avoid zero denominator.
    step: Step count.
    m: Biased first moment estimate (a list with one value per parameter).
    v: Biased second raw moment estimate (a list with one value per parameter).
class_docstr_tok: ["Adaptive","Moment","Estimation","(","Adam",")","optimizer",".","Adam","is","an","algorithm","for","first-order","gradient-based","optimization","of","stochastic","objective","functions",",","based","on","adaptive","estimates","of","lower-order","moments",".","See",":","cite",":","`","kingma2014adam","`","for","more","details",".","Note",":","default","parameter","values","have","been","taken","from","the","paper",".","Attributes",":","learning_rate",":","Step","size","(","``","alpha","``","in","the","paper",")",".","beta1",":","Exponential","decay","rate","for","first","moment","estimate",".","beta2",":","Exponential","decay","rate","for","second","moment","estimate",".","epsilon",":","Small","value","to","avoid","zero","denominator",".","step",":","Step","count",".","m",":","Biased","first","moment","estimate","(","a","list","with","one","value","per","parameter",")",".","v",":","Biased","second","raw","moment","estimate","(","a","list","with","one","value","per","parameter",")","."]
docstr: Constructs an `Adam` module.
  
  Args:
    learning_rate: Step size (``alpha`` in the paper).
    beta1: Exponential decay rate for first moment estimate.
    beta2: Exponential decay rate for second moment estimate.
    epsilon: Small value to avoid zero denominator.
    name: Name of the module.
docstr_tok: ["Constructs","an","`","Adam","`","module",".","Args",":","learning_rate",":","Step","size","(","``","alpha","``","in","the","paper",")",".","beta1",":","Exponential","decay","rate","for","first","moment","estimate",".","beta2",":","Exponential","decay","rate","for","second","moment","estimate",".","epsilon",":","Small","value","to","avoid","zero","denominator",".","name",":","Name","of","the","module","."]
code: def __init__(
      self,
      learning_rate: Union[types.FloatLike, tf.Variable] = 0.001,
      beta1: Union[types.FloatLike, tf.Variable] = 0.9,
      beta2: Union[types.FloatLike, tf.Variable] = 0.999,
      epsilon: Union[types.FloatLike, tf.Variable] = 1e-8,
      name: Optional[str] = None,
  ):
      """Constructs an `Adam` module.
  
      Args:
        learning_rate: Step size (``alpha`` in the paper).
        beta1: Exponential decay rate for first moment estimate.
        beta2: Exponential decay rate for second moment estimate.
        epsilon: Small value to avoid zero denominator.
        name: Name of the module.
      """
      super().__init__(name=name)
      self.learning_rate = learning_rate
      self.beta1 = beta1
      self.beta2 = beta2
      self.epsilon = epsilon
      # TODO(petebu): Consider allowing the user to pass in a step.
      self.step = tf.Variable(
          0, trainable=False, name="t", dtype=tf.int64
      )
      self.m = []
      self.v = []
  
file_path: sonnet/sonnet/src/optimizers/adam.py
imports: from typing import Optional, Sequence, Union
  from sonnet.src import base
  from sonnet.src import once
  from sonnet.src import types
  from sonnet.src import utils
  from sonnet.src.optimizers import optimizer_utils
  import tensorflow
label_desc: Use image node_id 1 to create a new Adam object from inherited base classes: base with example: obj = Adam(learning_rate, beta1, beta2, epsilon, name)