class_docstr: Implements a pytorch variant of Adan
  Adan was proposed in
  Adan: Adaptive Nesterov Momentum Algorithm for
      Faster Optimizing Deep Models[J].arXiv preprint arXiv:2208.06677, 2022.
  https://arxiv.org/abs/2208.06677
  Arguments:
      params (iterable): iterable of parameters to optimize or
          dicts defining parameter groups.
      lr (float, optional): learning rate. (default: 1e-3)
      betas (Tuple[float, float, flot], optional): coefficients used for
          first- and second-order moments. (default: (0.98, 0.92, 0.99))
      eps (float, optional): term added to the denominator to improve
          numerical stability. (default: 1e-8)
      weight_decay (float, optional): decoupled weight decay
          (L2 penalty) (default: 0)
      max_grad_norm (float, optional): value used to clip
          global grad norm (default: 0.0 no clip)
      no_prox (bool): how to perform the decoupled weight decay
          (default: False)
      foreach (bool): if True would use torch._foreach implementation.
          It's faster but uses slightly more memory. (default: True)
      fused (bool, optional): whether fused implementation is used.
          (default: False)
class_docstr_tok: ["Implements","a","pytorch","variant","of","Adan","Adan","was","proposed","in","Adan",":","Adaptive","Nesterov","Momentum","Algorithm","for","Faster","Optimizing","Deep","Models","[","J","]",".arXiv","preprint","arXiv:2208.06677",",","2022.","https",":","\/\/arxiv.org\/abs\/2208.06677","Arguments",":","params","(","iterable",")",":","iterable","of","parameters","to","optimize","or","dicts","defining","parameter","groups",".","lr","(","float",",","optional",")",":","learning","rate",".","(","default",":","1e-3",")","betas","(","Tuple","[","float",",","float",",","flot","]",",","optional",")",":","coefficients","used","for","first-","and","second-order","moments",".","(","default",":","(","0.98",",","0.92",",","0.99",")",")","eps","(","float",",","optional",")",":","term","added","to","the","denominator","to","improve","numerical","stability",".","(","default",":","1e-8",")","weight_decay","(","float",",","optional",")",":","decoupled","weight","decay","(","L2","penalty",")","(","default",":","0",")","max_grad_norm","(","float",",","optional",")",":","value","used","to","clip","global","grad","norm","(","default",":","0.0","no","clip",")","no_prox","(","bool",")",":","how","to","perform","the","decoupled","weight","decay","(","default",":","False",")","foreach","(","bool",")",":","if","True","would","use","torch._foreach","implementation",".","It","'s","faster","but","uses","slightly","more","memory",".","(","default",":","True",")","fused","(","bool",",","optional",")",":","whether","fused","implementation","is","used",".","(","default",":","False",")"]
code: def __init__(
      self,
      params,
      lr=1e-3,
      betas=(0.98, 0.92, 0.99),
      eps=1e-8,
      weight_decay=0.0,
      max_grad_norm=0.0,
      no_prox=False,
      foreach: bool = True,
      fused: bool = False,
  ):
      if not 0.0 <= max_grad_norm:
          raise ValueError(
              "Invalid Max grad norm: {}".format(max_grad_norm)
          )
      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])
          )
      if not 0.0 <= betas[2] < 1.0:
          raise ValueError(
              "Invalid beta parameter at index 2: {}".format(betas[2])
          )
      defaults = dict(
          lr=lr,
          betas=betas,
          eps=eps,
          weight_decay=weight_decay,
          max_grad_norm=max_grad_norm,
          no_prox=no_prox,
          foreach=foreach,
          fused=fused,
      )
      super().__init__(params, defaults)
  
file_path: NeMo/nemo/core/optim/adan.py
imports: import math
  from typing import List
  import torch
  from torch import Tensor
  from torch.optim.optimizer import Optimizer
label_desc: Use image node_id 1 to create a new Adan object from inherited base classes: Optimizer with example: obj = Adan(params, lr, betas, eps, weight_decay, max_grad_norm, no_prox, foreach, fused)