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.
code: def __init__(self, stepsize=0.01, momentum=0.9):
      super().__init__(stepsize)
      self.momentum = momentum
      self.accumulation = None
  
imports: from .gradient_descent import GradientDescentOptimizer
label_desc: Use image node_id 1 to create a new MomentumOptimizer object from inherited base classes: GradientDescentOptimizer with example: obj = MomentumOptimizer(stepsize, momentum)