code: def momentum_update(
      update, learning_rate, mu, momentum, use_nesterov
  ):
      """Computes a momentum update for a single parameter."""
      momentum = (mu * momentum) + update
      if use_nesterov:
          update = learning_rate * ((mu * momentum) + update)
      else:
          update = learning_rate * momentum
      return update, 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 for calling a global function with example usage: momentum_update(update, learning_rate, mu, momentum, use_nesterov) and returns: update,  momentum