code: def adam_update(g, alpha, beta_1, beta_2, epsilon, t, m, v):
      """Implements 'Algorithm 1' from :cite:`kingma2014adam`."""
      m = (
          beta_1 * m + (1.0 - beta_1) * g
      )  # Biased first moment estimate.
      v = (
          beta_2 * v + (1.0 - beta_2) * g * g
      )  # Biased second raw moment estimate.
      m_hat = m / (
          1.0 - tf.pow(beta_1, t)
      )  # Bias corrected 1st moment estimate.
      v_hat = v / (
          1.0 - tf.pow(beta_2, t)
      )  # Bias corrected 2nd moment estimate.
      update = alpha * m_hat / (tf.sqrt(v_hat) + epsilon)
      return update, m, 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 for calling a global function with example usage: adam_update(g, alpha, beta_1, beta_2, epsilon, t, m, v) and returns: update,  m,  v