class_docstr: SGD with Momentum module.
  
  Attributes:
    learning_rate: Learning rate.
    momentum: Momentum scalar.
    use_nesterov: `True` if using Nesterov momentum.
    accumulated_momentum: Accumulated momentum for each parameter.
class_docstr_tok: ["SGD","with","Momentum","module",".","Attributes",":","learning_rate",":","Learning","rate",".","momentum",":","Momentum","scalar",".","use_nesterov",":","`","True","`","if","using","Nesterov","momentum",".","accumulated_momentum",":","Accumulated","momentum","for","each","parameter","."]
docstr: Constructs a `Momentum` module.
  
  Args:
    learning_rate: Learning rate.
    momentum: Momentum scalar.
    use_nesterov: Whether to use Nesterov momentum.
    name: Name of the module.
docstr_tok: ["Constructs","a","`","Momentum","`","module",".","Args",":","learning_rate",":","Learning","rate",".","momentum",":","Momentum","scalar",".","use_nesterov",":","Whether","to","use","Nesterov","momentum",".","name",":","Name","of","the","module","."]
code: def __init__(
      self,
      learning_rate: Union[types.FloatLike, tf.Variable],
      momentum: Union[types.FloatLike, tf.Variable],
      use_nesterov: bool = False,
      name: Optional[str] = None,
  ):
      """Constructs a `Momentum` module.
  
      Args:
        learning_rate: Learning rate.
        momentum: Momentum scalar.
        use_nesterov: Whether to use Nesterov momentum.
        name: Name of the module.
      """
      super().__init__(name)
      self.learning_rate = learning_rate
      self.momentum = momentum  # TODO(petebu) Reconsider name.
      self.use_nesterov = use_nesterov
      self.accumulated_momentum = []
  
file_path: sonnet/sonnet/src/optimizers/momentum.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 to create a new Momentum object from inherited base classes: base with example: obj = Momentum(learning_rate, momentum, use_nesterov, name)