class_docstr: Gradient-descent optimizer with past-gradient-dependent
  learning rate in each dimension.
  
  Adagrad adjusts the learning rate for each parameter :math:`x_i`
  in :math:`x` based on past gradients. We therefore have to consider
  each parameter update individually,
  
  .. math::
      x^{(t+1)}_i = x^{(t)}_i - \eta_i^{(t+1)} \partial_{w_i} f(x^{(t)}),
  
  where the gradient is replaced by a (scalar) partial derivative.
  
  The learning rate in step :math:`t` is given by
  
  .. math::
      \eta_i^{(t+1)} = \frac{ \eta_{\mathrm{init}} }{ \sqrt{a_i^{(t+1)} + \epsilon } },
      ~~~ a_i^{(t+1)} = \sum_{k=1}^t (\partial_{x_i} f(x^{(k)}))^2.
  
  The offset :math:`\epsilon` avoids division by zero.
  
  :math:`\eta` is the step size, a user defined parameter.
  
  Args:
      stepsize (float): the user-defined hyperparameter :math:`\eta`
      eps (float): offset :math:`\epsilon` added for numerical stability
  
  .. note::
  
      When using ``torch``, ``tensorflow`` or ``jax`` interfaces, refer to :doc:`Gradients and training </introduction/interfaces>` for suitable optimizers.
docstr: Update the accumulation at index with gradient.
  
  Args:
      index (int): index of parameter to update.
      grad_flat (ndarray): gradient at index
docstr_tok: ["Update","the","accumulation","at","index","with","gradient",".","Args",":","index","(","int",")",":","index","of","parameter","to","update",".","grad_flat","(","ndarray",")",":","gradient","at","index"]
code: def _update_accumulation(self, index, grad):
      r"""Update the accumulation at index with gradient.
  
      Args:
          index (int): index of parameter to update.
          grad_flat (ndarray): gradient at index
      """
      self.accumulation[index] = self.accumulation[index] + grad**2
  
imports: from numpy import sqrt
  from .gradient_descent import GradientDescentOptimizer
label_desc: Use image node_id 3 for calling the AdagradOptimizer obj's underlying member method code with example usage: obj._update_accumulation(index, grad) without return types