class_docstr: Implements Yogi Optimizer Algorithm.
  It has been proposed in `Adaptive methods for Nonconvex Optimization`__.
  
  Arguments:
      params: iterable of parameters to optimize or dicts defining
          parameter groups
      lr: learning rate (default: 1e-2)
      betas: coefficients used for computing
          running averages of gradient and its square (default: (0.9, 0.999))
      eps: term added to the denominator to improve
          numerical stability (default: 0.001)
      initial_accumulator: initial values for first and
          second moments (default: 1e-6)
      weight_decay: weight decay (L2 penalty) (default: 0)
  
  Example:
      >>> import torch_optimizer as optim
      >>> optimizer = optim.Yogi(model.parameters(), lr=0.01)
      >>> optimizer.zero_grad()
      >>> loss_fn(model(input), target).backward()
      >>> optimizer.step()
  
  __ https://papers.nips.cc/paper/8186-adaptive-methods-for-nonconvex-optimization  # noqa
  
  Note:
      Reference code: https://github.com/4rtemi5/Yogi-Optimizer_Keras
code: def __init__(
      self,
      params: Params,
      lr: float = 1e-2,
      betas: Betas2 = (0.9, 0.999),
      eps: float = 1e-3,
      initial_accumulator: float = 1e-6,
      weight_decay: float = 0,
  ) -> 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 weight_decay < 0:
          raise ValueError(
              "Invalid weight_decay value: {}".format(weight_decay)
          )
  
      defaults = dict(
          lr=lr,
          betas=betas,
          eps=eps,
          initial_accumulator=initial_accumulator,
          weight_decay=weight_decay,
      )
      super(Yogi, self).__init__(params, defaults)
  
file_path: pytorch-optimizer/torch_optimizer/yogi.py
imports: import math
  import torch
  import torch.nn
  from torch.optim.optimizer import Optimizer
  from .types import Betas2, OptFloat, OptLossClosure, Params
label_desc: Use image node_id 1 to create a new Yogi object from inherited base classes: Optimizer with example: obj = Yogi(params, lr, betas, eps, initial_accumulator, weight_decay)