class_docstr: Variant of the Adam optimizer whose adaptive learning rate is rectified
  so as to have a consistent variance.
  
  It implements the Rectified Adam (a.k.a. RAdam) proposed by
  Liyuan Liu et al. in [On The Variance Of The Adaptive Learning Rate
  And Beyond](https://arxiv.org/pdf/1908.03265v1.pdf).
  
  Example of usage:
  
  ```python
  opt = tfa.optimizers.RectifiedAdam(lr=1e-3)
  ```
  
  Note: `amsgrad` is not described in the original paper. Use it with
        caution.
  
  RAdam is not a placement of the heuristic warmup, the settings should be
  kept if warmup has already been employed and tuned in the baseline method.
  You can enable warmup by setting `total_steps` and `warmup_proportion`:
  
  ```python
  opt = tfa.optimizers.RectifiedAdam(
      lr=1e-3,
      total_steps=10000,
      warmup_proportion=0.1,
      min_lr=1e-5,
  )
  ```
  
  In the above example, the learning rate will increase linearly
  from 0 to `lr` in 1000 steps, then decrease linearly from `lr` to `min_lr`
  in 9000 steps.
  
  Lookahead, proposed by Michael R. Zhang et.al in the paper
  [Lookahead Optimizer: k steps forward, 1 step back]
  (https://arxiv.org/abs/1907.08610v1), can be integrated with RAdam,
  which is announced by Less Wright and the new combined optimizer can also
  be called "Ranger". The mechanism can be enabled by using the lookahead
  wrapper. For example:
  
  ```python
  radam = tfa.optimizers.RectifiedAdam()
  ranger = tfa.optimizers.Lookahead(radam, sync_period=6, slow_step_size=0.5)
  ```
class_docstr_tok: ["Variant","of","the","Adam","optimizer","whose","adaptive","learning","rate","is","rectified","so","as","to","have","a","consistent","variance",".","It","implements","the","Rectified","Adam","(","a.k.a",".","RAdam",")","proposed","by","Liyuan","Liu","et","al",".","in","[","On","The","Variance","Of","The","Adaptive","Learning","Rate","And","Beyond","]","(","https",":","\/\/arxiv.org\/pdf\/1908.03265v1.pdf",")",".","Example","of","usage",":","``","`","python","opt","=","tfa.optimizers.RectifiedAdam","(","lr=1e-3",")","``","`","Note",":","`","amsgrad","`","is","not","described","in","the","original","paper",".","Use","it","with","caution",".","RAdam","is","not","a","placement","of","the","heuristic","warmup",",","the","settings","should","be","kept","if","warmup","has","already","been","employed","and","tuned","in","the","baseline","method",".","You","can","enable","warmup","by","setting","`","total_steps","`","and","`","warmup_proportion","`",":","``","`","python","opt","=","tfa.optimizers.RectifiedAdam","(","lr=1e-3",",","total_steps=10000",",","warmup_proportion=0.1",",","min_lr=1e-5",",",")","``","`","In","the","above","example",",","the","learning","rate","will","increase","linearly","from","0","to","`","lr","`","in","1000","steps",",","then","decrease","linearly","from","`","lr","`","to","`","min_lr","`","in","9000","steps",".","Lookahead",",","proposed","by","Michael","R.","Zhang","et.al","in","the","paper","[","Lookahead","Optimizer",":","k","steps","forward",",","1","step","back","]","(","https",":","\/\/arxiv.org\/abs\/1907.08610v1",")",",","can","be","integrated","with","RAdam",",","which","is","announced","by","Less","Wright","and","the","new","combined","optimizer","can","also","be","called","``","Ranger","''",".","The","mechanism","can","be","enabled","by","using","the","lookahead","wrapper",".","For","example",":","``","`","python","radam","=","tfa.optimizers.RectifiedAdam","(",")","ranger","=","tfa.optimizers.Lookahead","(","radam",",","sync_period=6",",","slow_step_size=0.5",")","``","`"]
code: def set_weights(self, weights):
      params = self.weights
      num_vars = int((len(params) - 1) / 2)
      if len(weights) == 3 * num_vars + 1:
          weights = weights[: len(params)]
      super().set_weights(weights)
  
file_path: addons/tensorflow_addons/optimizers/rectified_adam.py
imports: import tensorflow
  from tensorflow_addons.utils.types import FloatTensorLike
  from tensorflow_addons.optimizers import KerasLegacyOptimizer
  from typing import Union, Callable, Dict
  from typeguard import typechecked
label_desc: Use image node_id 3 for calling the RectifiedAdam obj's underlying member method code with example usage: obj.set_weights(weights) without return types