def METHOD_NAME(param,
                     g_t,
                     lr,
                     grad_buffer,
                     m,
                     window,
                     t,
                     beta1=0.9,
                     eps=1e-4,
                     svd_eps=1e-6,
                     sigma_eps=1e-2):
  """Tests the correctness of one step of GGT."""
  m_t = m * beta1 + (1 - beta1) * g_t
  grad_buffer[((t - 1) % window), :] = m_t
  m_matrix = np.transpose(grad_buffer / np.sqrt(np.minimum(t, window)))
  mm = np.dot(np.transpose(m_matrix), m_matrix)
  damping = np.eye(window) * svd_eps
  u, sigma, _ = np.linalg.svd(mm + damping)
  sigma_sqrt_inv = np.power(np.sqrt(sigma) + sigma_eps, -3)
  new_step = np.linalg.multi_dot([
      m_matrix, u,
      np.diag(sigma_sqrt_inv),
      np.transpose(u),
      np.transpose(m_matrix), m_t
  ])
  sigma_sqrt_min = np.sqrt(sigma).min()
  if sigma_sqrt_min > eps:
    new_step += (m_t - np.linalg.multi_dot([
        m_matrix, u,
        np.diag(1.0 / sigma),
        np.transpose(u),
        np.transpose(m_matrix), m_t
    ])) * (1.0 / sigma_sqrt_min)
  param_t = param - lr * new_step
  return param_t, m_t, grad_buffer