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: 0.5)
      seed (int, optional): Random number generator seed (default: None)
  
      Example:
      >>> import torch_optimizer as optim
      >>> optimizer = optim.Adahessian(model.parameters(), lr = 1.0)
      >>> optimizer.zero_grad()
      >>> loss_fn(model(input), target).backward(create_graph=True)
      >>> optimizer.step()
  
      __ https://arxiv.org/abs/2006.00719
  
      Note:
          Reference code: https://github.com/amirgholami/adahessian
code: def __init__(
      self,
      params: Params,
      lr: float = 0.15,
      betas: Betas2 = (0.9, 0.999),
      eps: float = 1e-4,
      weight_decay: float = 0,
      hessian_power: float = 0.5,
      seed: Optional[int] = None,
  ) -> None:
      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])
          )
      if not 0.0 <= hessian_power <= 1.0:
          raise ValueError(
              "Invalid Hessian power value: {}".format(hessian_power)
          )
      if seed is not None:
          torch.manual_seed(seed)
      defaults = dict(
          lr=lr,
          betas=betas,
          eps=eps,
          weight_decay=weight_decay,
          hessian_power=hessian_power,
      )
      super(Adahessian, self).__init__(params, defaults)
  
file_path: pytorch-optimizer/torch_optimizer/adahessian.py
imports: import math
  from typing import List, Optional
  import torch
  from torch.optim.optimizer import Optimizer
  from .types import Betas2, OptFloat, OptLossClosure, Params
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, seed)