class_docstr: Stochastic Gradient Descent (SGD) optimizer.
docstr: Updates variables based on SGD algorithm.
  
  Args:
      lr: the learning rate.
      grads: the gradients to apply.
docstr_tok: ["Updates","variables","based","on","SGD","algorithm",".","Args",":","lr",":","the","learning","rate",".","grads",":","the","gradients","to","apply","."]
code: def __call__(self, lr: float, grads: List[JaxArray]):
      """Updates variables based on SGD algorithm.
  
      Args:
          lr: the learning rate.
          grads: the gradients to apply.
      """
      assert len(grads) == len(
          self.train_vars
      ), "Expecting as many gradients as trainable variables"
      for g, p in zip(grads, self.train_vars):
          p.value -= lr * g
  
file_path: objax/objax/optimizer/sgd.py
imports: from typing import List
  from objax.module import Module, ModuleList
  from objax.typing import JaxArray
  from objax.util import class_name
  from objax.variable import TrainRef, TrainVar, VarCollection
label_desc: Use image node_id 2 for calling the SGD obj's underlying member method code with example usage: obj.__call__(lr, grads) without return types