class_docstr: `AdaBelief Optimizer, adapting stepsizes by the belief in observed gradients`
  Paper: https://arxiv.org/abs/2010.07468
  Implementation has been copied over from the original author (https://github.com/juntang-zhuang/Adabelief-Optimizer)
class_docstr_tok: ["`","AdaBelief","Optimizer",",","adapting","stepsizes","by","the","belief","in","observed","gradients","`","Paper",":","https",":","\/\/arxiv.org\/abs\/2010.07468","Implementation","has","been","copied","over","from","the","original","author","(","https",":","\/\/github.com\/juntang-zhuang\/Adabelief-Optimizer",")"]
code: def __init__(
      self,
      params,
      lr=1e-3,
      betas=(0.9, 0.999),
      eps=1e-8,
      weight_decay=0,
      amsgrad=False,
      weight_decouple=False,
      fixed_decay=False,
      rectify=False,
  ):
      if not 0.0 <= lr:
          raise ValueError("Invalid learning rate: {}".format(lr))
      if not 0.0 <= eps:
          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])
          )
      defaults = dict(
          lr=lr,
          betas=betas,
          eps=eps,
          weight_decay=weight_decay,
          amsgrad=amsgrad,
      )
      PT_Optimizer.__init__(self, params, defaults)
  
      self.weight_decouple = weight_decouple
      self.rectify = rectify
      self.fixed_decay = fixed_decay
      if self.weight_decouple:
          print("Weight decoupling enabled in AdaBelief")
          if self.fixed_decay:
              print("Weight decay fixed")
      if self.rectify:
          print("Rectification enabled in AdaBelief")
      if amsgrad:
          print("AMS enabled in AdaBelief")
  
file_path: pytext/pytext/optimizer/adabelief.py
imports: import math
  import torch
  from torch.optim.optimizer import Optimizer
  from .optimizers import Optimizer
label_desc: Use image node_id 2 to create a new AdaBelief object from inherited base classes: Optimizer, PT_Optimizer with example: obj = AdaBelief(params, lr, betas, eps, weight_decay, amsgrad, weight_decouple, fixed_decay, rectify)