code: def __init__(
      self,
      params,
      lr=1e-3,
      betas=(0.9, 0.999),
      eps=1e-8,
      weight_decay=0,
      degenerated_to_sgd=True,
  ):
      if lr < 0.0:
          raise ValueError("Invalid learning rate: {}".format(lr))
      if eps < 0.0:
          raise ValueError("Invalid epsilon value: {}".format(eps))
      if not 0.0 <= betas[0] < 1.0:
          raise ValueError(
              "Invalid beta parameter at index 0: {}".format(betas[0])
          )
      if not 0.0 <= betas[1] < 1.0:
          raise ValueError(
              "Invalid beta parameter at index 1: {}".format(betas[1])
          )
  
      self.degenerated_to_sgd = degenerated_to_sgd
      if (
          isinstance(params, (list, tuple))
          and len(params) > 0
          and isinstance(params[0], dict)
      ):
          for param in params:
              if "betas" in param and (
                  param["betas"][0] != betas[0]
                  or param["betas"][1] != betas[1]
              ):
                  param["buffer"] = [
                      [None, None, None] for _ in range(10)
                  ]
      defaults = dict(
          lr=lr,
          betas=betas,
          eps=eps,
          weight_decay=weight_decay,
          buffer=[[None, None, None] for _ in range(10)],
      )
      super(RAdam, self).__init__(params, defaults)
  
file_path: TTS/TTS/utils/radam.py
imports: import math
  import torch
  from torch.optim.optimizer import Optimizer
label_desc: Use image node_id 1 to create a new RAdam object from inherited base classes: Optimizer with example: obj = RAdam(params, lr, betas, eps, weight_decay, degenerated_to_sgd)