class_docstr: Implements Apollo Optimizer Algorithm.
  
  It has been proposed in `Apollo: An Adaptive Parameter-wise Diagonal
  Quasi-Newton Method for Nonconvex Stochastic Optimization`__.
  
  Arguments:
      params: iterable of parameters to optimize or dicts defining
          parameter groups
      lr: learning rate (default: 1e-2)
      beta: coefficient used for computing
          running averages of gradient (default: 0.9)
      eps: term added to the denominator to improve
          numerical stability (default: 1e-4)
      warmup: number of warmup steps (default: 0)
      init_lr: initial learning rate for warmup (default: 0.01)
      weight_decay: weight decay (L2 penalty) (default: 0)
  
  Example:
      >>> import torch_optimizer as optim
      >>> optimizer = optim.Apollo(model.parameters(), lr=0.01)
      >>> optimizer.zero_grad()
      >>> loss_fn(model(input), target).backward()
      >>> optimizer.step()
  
  __ https://arxiv.org/abs/2009.13586
  
  Note:
      Reference code: https://github.com/XuezheMax/apollo
code: def __init__(
      self,
      params: Params,
      lr: float = 1e-2,
      beta: float = 0.9,
      eps: float = 1e-4,
      warmup: int = 0,
      init_lr: float = 0.01,
      weight_decay: float = 0,
  ):
      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 <= beta < 1.0:
          raise ValueError("Invalid beta parameter: {}".format(beta))
      if not 0.0 <= weight_decay:
          raise ValueError(
              "Invalid weight_decay value: {}".format(weight_decay)
          )
      if not 0.0 <= warmup:
          raise ValueError("Invalid warmup updates: {}".format(warmup))
      if not 0.0 <= init_lr <= 1.0:
          raise ValueError(
              "Invalid initial learning rate: {}".format(init_lr)
          )
  
      defaults = dict(
          lr=lr,
          beta=beta,
          eps=eps,
          warmup=warmup,
          init_lr=init_lr,
          base_lr=lr,
          weight_decay=weight_decay,
      )
      super(Apollo, self).__init__(params, defaults)
  
imports: import torch
  from torch.optim.optimizer import Optimizer
  from .types import OptFloat, OptLossClosure, Params
label_desc: Use image node_id 1 to create a new Apollo object from inherited base classes: Optimizer with example: obj = Apollo(params, lr, beta, eps, warmup, init_lr, weight_decay)