class_docstr: Stochastic gradient descent (SGD) optimizer.
class_docstr_tok: ["Stochastic","gradient","descent","(","SGD",")","optimizer","."]
code: def update(self, step, grads, weights, slots, opt_params):
      del step, slots
      lr = opt_params["learning_rate"]
      new_weights = weights - (lr * grads).astype(weights.dtype)
      return new_weights, None
  
file_path: trax/trax/optimizers/base.py
imports: from trax import fastmath
  from trax.fastmath import numpy
label_desc: Use image node_id 2 for calling the SGD obj's underlying member method code with example usage: obj.update(step, grads, weights, slots, opt_params) and returns: new_weights,  None