class_docstr: Optimizer that implements the RMSprop algorithm.
  
  The gist of RMSprop is to:
  
  - Maintain a moving (discounted) average of the square of gradients
  - Divide the gradient by the root of this average
  
  This implementation of RMSprop uses plain momentum, not Nesterov momentum.
  
  The centered version additionally maintains a moving average of the
  gradients, and uses that average to estimate the variance.
  
  Args:
    learning_rate: A `Tensor`, floating point value, or a schedule that is a
      `tf.keras.optimizers.schedules.LearningRateSchedule`, or a callable
      that takes no arguments and returns the actual value to use. The
      learning rate. Defaults to 0.001.
    rho: Discounting factor for the history/coming gradient. Defaults to 0.9.
    momentum: A scalar or a scalar `Tensor`. Defaults to 0.0.
    epsilon: A small constant for numerical stability. This epsilon is
      "epsilon hat" in the Kingma and Ba paper (in the formula just before
      Section 2.1), not the epsilon in Algorithm 1 of the paper. Defaults to
      1e-7.
    centered: Boolean. If `True`, gradients are normalized by the estimated
      variance of the gradient; if False, by the uncentered second moment.
      Setting this to `True` may help with training, but is slightly more
      expensive in terms of computation and memory. Defaults to `False`.
    name: Optional name prefix for the operations created when applying
      gradients. Defaults to `"RMSprop"`.
    **kwargs: Keyword arguments. Allowed to be one of
      `"clipnorm"` or `"clipvalue"`.
      `"clipnorm"` (float) clips gradients by norm; `"clipvalue"` (float) clips
      gradients by value.
  
  Note that in the dense implementation of this algorithm, variables and their
  corresponding accumulators (momentum, gradient moving average, square
  gradient moving average) will be updated even if the gradient is zero
  (i.e. accumulators will decay, momentum will be applied). The sparse
  implementation (used when the gradient is an `IndexedSlices` object,
  typically because of `tf.gather` or an embedding lookup in the forward pass)
  will not update variable slices or their accumulators unless those slices
  were used in the forward pass (nor is there an "eventual" correction to
  account for these omitted updates). This leads to more efficient updates for
  large embedding lookup tables (where most of the slices are not accessed in
  a particular graph execution), but differs from the published algorithm.
  
  Usage:
  
  >>> opt = tf.keras.optimizers.RMSprop(learning_rate=0.1)
  >>> var1 = tf.Variable(10.0)
  >>> loss = lambda: (var1 ** 2) / 2.0    # d(loss) / d(var1) = var1
  >>> step_count = opt.minimize(loss, [var1]).numpy()
  >>> var1.numpy()
  9.683772
  
  Reference:
    - [Hinton, 2012](
      http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf)
class_docstr_tok: ["Optimizer","that","implements","the","RMSprop","algorithm",".","The","gist","of","RMSprop","is","to",":","-","Maintain","a","moving","(","discounted",")","average","of","the","square","of","gradients","-","Divide","the","gradient","by","the","root","of","this","average","This","implementation","of","RMSprop","uses","plain","momentum",",","not","Nesterov","momentum",".","The","centered","version","additionally","maintains","a","moving","average","of","the","gradients",",","and","uses","that","average","to","estimate","the","variance",".","Args",":","learning_rate",":","A","`","Tensor","`",",","floating","point","value",",","or","a","schedule","that","is","a","`","tf.keras.optimizers.schedules.LearningRateSchedule","`",",","or","a","callable","that","takes","no","arguments","and","returns","the","actual","value","to","use",".","The","learning","rate",".","Defaults","to","0.001.","rho",":","Discounting","factor","for","the","history\/coming","gradient",".","Defaults","to","0.9.","momentum",":","A","scalar","or","a","scalar","`","Tensor","`",".","Defaults","to","0.0.","epsilon",":","A","small","constant","for","numerical","stability",".","This","epsilon","is","``","epsilon","hat","''","in","the","Kingma","and","Ba","paper","(","in","the","formula","just","before","Section","2.1",")",",","not","the","epsilon","in","Algorithm","1","of","the","paper",".","Defaults","to","1e-7",".","centered",":","Boolean",".","If","`","True","`",",","gradients","are","normalized","by","the","estimated","variance","of","the","gradient",";","if","False",",","by","the","uncentered","second","moment",".","Setting","this","to","`","True","`","may","help","with","training",",","but","is","slightly","more","expensive","in","terms","of","computation","and","memory",".","Defaults","to","`","False","`",".","name",":","Optional","name","prefix","for","the","operations","created","when","applying","gradients",".","Defaults","to","`","``","RMSprop","''","`",".","*","*","kwargs",":","Keyword","arguments",".","Allowed","to","be","one","of","`","``","clipnorm","''","`","or","`","``","clipvalue","''","`",".","`","``","clipnorm","''","`","(","float",")","clips","gradients","by","norm",";","`","``","clipvalue","''","`","(","float",")","clips","gradients","by","value",".","Note","that","in","the","dense","implementation","of","this","algorithm",",","variables","and","their","corresponding","accumulators","(","momentum",",","gradient","moving","average",",","square","gradient","moving","average",")","will","be","updated","even","if","the","gradient","is","zero","(","i.e",".","accumulators","will","decay",",","momentum","will","be","applied",")",".","The","sparse","implementation","(","used","when","the","gradient","is","an","`","IndexedSlices","`","object",",","typically","because","of","`","tf.gather","`","or","an","embedding","lookup","in","the","forward","pass",")","will","not","update","variable","slices","or","their","accumulators","unless","those","slices","were","used","in","the","forward","pass","(","nor","is","there","an","``","eventual","''","correction","to","account","for","these","omitted","updates",")",".","This","leads","to","more","efficient","updates","for","large","embedding","lookup","tables","(","where","most","of","the","slices","are","not","accessed","in","a","particular","graph","execution",")",",","but","differs","from","the","published","algorithm",".","Usage",":",">",">",">","opt","=","tf.keras.optimizers.RMSprop","(","learning_rate=0.1",")",">",">",">","var1","=","tf.Variable","(","10.0",")",">",">",">","loss","=","lambda",":","(","var1","*","*","2",")","\/","2.0","#","d","(","loss",")","\/","d","(","var1",")","=","var1",">",">",">","step_count","=","opt.minimize","(","loss",",","[","var1","]",")",".numpy","(",")",">",">",">","var1.numpy","(",")","9.683772","Reference",":","-","[","Hinton",",","2012","]","(","http",":","\/\/www.cs.toronto.edu\/~tijmen\/csc321\/slides\/lecture_slides_lec6.pdf",")"]
code: def get_config(self):
      config = super(RMSprop, self).get_config()
      config.update(
          {
              "learning_rate": self._serialize_hyperparameter(
                  "learning_rate"
              ),
              "decay": self._initial_decay,
              "rho": self._serialize_hyperparameter("rho"),
              "momentum": self._serialize_hyperparameter("momentum"),
              "epsilon": self.epsilon,
              "centered": self.centered,
          }
      )
      return config
  
file_path: tensorflow-upstream/tensorflow/python/keras/optimizer_v2/rmsprop.py
imports: import numpy
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_conversion
  from tensorflow.python.keras import backend_config
  from tensorflow.python.keras.optimizer_v2 import optimizer_v2
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import gen_training_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import state_ops
label_desc: Use image node_id 7 for calling the RMSprop obj's underlying member method code with example usage: obj.get_config() and returns: config