class_docstr: Gradient-descent optimizer with momentum.
  
  The momentum optimizer adds a "momentum" term to gradient descent
  which considers the past gradients:
  
  .. math:: x^{(t+1)} = x^{(t)} - a^{(t+1)}.
  
  The accumulator term :math:`a` is updated as follows:
  
  .. math:: a^{(t+1)} = m a^{(t)} + \eta \nabla f(x^{(t)}),
  
  with user defined parameters:
  
  * :math:`\eta`: the step size
  * :math:`m`: the momentum
  
  Args:
      stepsize (float): user-defined hyperparameter :math:`\eta`
      momentum (float): user-defined hyperparameter :math:`m`
  
  .. note::
  
      When using ``torch``, ``tensorflow`` or ``jax`` interfaces, refer to :doc:`Gradients and training </introduction/interfaces>` for suitable optimizers.
docstr: Update the accumulation.
  
  Args:
      index (int): index of argument to update.
      grad (ndarray): gradient at index
docstr_tok: ["Update","the","accumulation",".","Args",":","index","(","int",")",":","index","of","argument","to","update",".","grad","(","ndarray",")",":","gradient","at","index"]
code: def _update_accumulation(self, index, grad):
      r"""Update the accumulation.
  
      Args:
          index (int): index of argument to update.
          grad (ndarray): gradient at index
      """
      self.accumulation[index] = (
          self.momentum * self.accumulation[index]
          + self.stepsize * grad
      )
  
imports: from .gradient_descent import GradientDescentOptimizer
label_desc: Use image node_id 3 for calling the MomentumOptimizer obj's underlying member method code with example usage: obj._update_accumulation(index, grad) without return types