class_docstr: Stochastic Gradient Descent.
  
  SGD Optimizer accepts learning rate decay. When training a model,
  it is often recommended to lower the learning rate as the training
  progresses. The function returns the decayed learning rate.  It is
  computed as:
  
  ```python
  decayed_learning_rate = learning_rate *
                        decay_rate ^ (global_step / decay_steps)
  ```
  
  Examples:
      ```python
      # With TFLearn estimators.
      sgd = SGD(learning_rate=0.01, lr_decay=0.96, decay_step=100)
      regression = regression(net, optimizer=sgd)
  
      # Without TFLearn estimators (returns tf.Optimizer).
      sgd = SGD(learning_rate=0.01).get_tensor()
      ```
  
  Arguments:
      learning_rate: `float`. Learning rate.
      use_locking: `bool`. If True use locks for update operation.
      lr_decay: `float`. The learning rate decay to apply.
      decay_step: `int`. Apply decay every provided steps.
      staircase: `bool`. It `True` decay learning rate at discrete intervals.
      use_locking: `bool`. If True use locks for update operation.
      name: `str`. Optional name prefix for the operations created when
          applying gradients. Defaults to "GradientDescent".
class_docstr_tok: ["Stochastic","Gradient","Descent",".","SGD","Optimizer","accepts","learning","rate","decay",".","When","training","a","model",",","it","is","often","recommended","to","lower","the","learning","rate","as","the","training","progresses",".","The","function","returns","the","decayed","learning","rate",".","It","is","computed","as",":","``","`","python","decayed_learning_rate","=","learning_rate","*","decay_rate","^","(","global_step","\/","decay_steps",")","``","`","Examples",":","``","`","python","#","With","TFLearn","estimators",".","sgd","=","SGD","(","learning_rate=0.01",",","lr_decay=0.96",",","decay_step=100",")","regression","=","regression","(","net",",","optimizer=sgd",")","#","Without","TFLearn","estimators","(","returns","tf.Optimizer",")",".","sgd","=","SGD","(","learning_rate=0.01",")",".get_tensor","(",")","``","`","Arguments",":","learning_rate",":","`","float","`",".","Learning","rate",".","use_locking",":","`","bool","`",".","If","True","use","locks","for","update","operation",".","lr_decay",":","`","float","`",".","The","learning","rate","decay","to","apply",".","decay_step",":","`","int","`",".","Apply","decay","every","provided","steps",".","staircase",":","`","bool","`",".","It","`","True","`","decay","learning","rate","at","discrete","intervals",".","use_locking",":","`","bool","`",".","If","True","use","locks","for","update","operation",".","name",":","`","str","`",".","Optional","name","prefix","for","the","operations","created","when","applying","gradients",".","Defaults","to","``","GradientDescent","''","."]
code: def build(self, step_tensor=None):
      self.built = True
      if self.has_decay:
          if not step_tensor:
              raise Exception(
                  "Learning rate decay but no step_tensor " "provided."
              )
          self.learning_rate = tf.train.exponential_decay(
              self.learning_rate,
              step_tensor,
              self.decay_step,
              self.lr_decay,
              staircase=self.staircase,
          )
          tf.add_to_collection(
              tf.GraphKeys.LR_VARIABLES, self.learning_rate
          )
      self.tensor = tf.train.GradientDescentOptimizer(
          learning_rate=self.learning_rate,
          use_locking=self.use_locking,
          name=self.name,
      )
  
imports: from __future__ import division, print_function, absolute_import
  import tensorflow.compat.v1
  from .utils import get_from_module
label_desc: Use image node_id 2 for calling the SGD obj's underlying member method code with example usage: obj.build(step_tensor) without return types