class_docstr: Implements Adahessian algorithm.
  It has been proposed in `ADAHESSIAN: An Adaptive Second Order Optimizer for Machine Learning`.
  Arguments:
      params (iterable): iterable of parameters to optimize or dicts defining
          parameter groups
      lr (float, optional): learning rate (default: 0.15)
      betas (Tuple[float, float], optional): coefficients used for computing
          running averages of gradient and its square (default: (0.9, 0.999))
      eps (float, optional): term added to the denominator to improve
          numerical stability (default: 1e-4)
      weight_decay (float, optional): weight decay (L2 penalty) (default: 0)
      hessian_power (float, optional): Hessian power (default: 1). You can also try 0.5. For some tasks we found this to result in better performance.
      single_gpu (Bool, optional): Do you use distributed training or not "torch.nn.parallel.DistributedDataParallel" (default: True)
code: def __init__(
      self,
      params,
      lr=0.15,
      betas=(0.9, 0.999),
      eps=1e-4,
      weight_decay=0,
      hessian_power=1,
      single_gpu=True,
  ):
      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 <= hessian_power <= 1.0:
          raise ValueError(
              "Invalid Hessian power value: {}".format(hessian_power)
          )
      defaults = dict(
          lr=lr,
          betas=betas,
          eps=eps,
          weight_decay=weight_decay,
          hessian_power=hessian_power,
      )
      self.single_gpu = single_gpu
      super(Adahessian, self).__init__(params, defaults)
  
file_path: bert-ultrafast/training/cramming/backend/optimizers/adahessian.py
imports: import math
  import torch
  from torch.optim.optimizer import Optimizer
label_desc: Use image node_id 1 to create a new Adahessian object from inherited base classes: Optimizer with example: obj = Adahessian(params, lr, betas, eps, weight_decay, hessian_power, single_gpu)