class_docstr: Novograd based on `Stochastic Gradient Methods with Layer-wise Adaptive Moments for Training of Deep Networks
  <https://arxiv.org/pdf/1905.11286.pdf>`_.
  The code is adapted from the implementations in `Jasper for PyTorch
  <https://github.com/NVIDIA/DeepLearningExamples/blob/master/PyTorch/SpeechRecognition/Jasper/common/optimizers.py>`_,
  and `OpenSeq2Seq <https://github.com/NVIDIA/OpenSeq2Seq/blob/master/open_seq2seq/optimizers/novograd.py>`_.
  
  Args:
      params: iterable of parameters to optimize or dicts defining parameter groups.
      lr: learning rate. Defaults to 1e-3.
      betas: coefficients used for computing running averages of gradient and its square. Defaults to (0.9, 0.98).
      eps: term added to the denominator to improve numerical stability. Defaults to 1e-8.
      weight_decay: weight decay (L2 penalty). Defaults to 0.
      grad_averaging: gradient averaging. Defaults to ``False``.
      amsgrad: whether to use the AMSGrad variant of this algorithm from the paper
          `On the Convergence of Adam and Beyond <https://arxiv.org/pdf/1904.09237.pdf>`_. Defaults to ``False``.
code: def __init__(
      self,
      params: Iterable,
      lr: float = 1e-3,
      betas: tuple[float, float] = (0.9, 0.98),
      eps: float = 1e-8,
      weight_decay: float = 0,
      grad_averaging: bool = False,
      amsgrad: bool = False,
  ):
      if 0.0 > lr:
          raise ValueError(f"Invalid learning rate: {lr}")
      if 0.0 > eps:
          raise ValueError(f"Invalid epsilon value: {eps}")
      if not 0.0 <= betas[0] < 1.0:
          raise ValueError(
              f"Invalid beta parameter at index 0: {betas[0]}"
          )
      if not 0.0 <= betas[1] < 1.0:
          raise ValueError(
              f"Invalid beta parameter at index 1: {betas[1]}"
          )
      if 0.0 > weight_decay:
          raise ValueError(
              f"Invalid weight_decay value: {weight_decay}"
          )
      defaults = dict(
          lr=lr,
          betas=betas,
          eps=eps,
          weight_decay=weight_decay,
          grad_averaging=grad_averaging,
          amsgrad=amsgrad,
      )
  
      super().__init__(params, defaults)
  
file_path: MONAI/monai/optimizers/novograd.py
imports: from __future__ import annotations
  from collections.abc import Callable, Iterable
  from typing import TypeVar
  import torch
  from torch.optim import Optimizer
label_desc: Use image node_id 1 to create a new Novograd object from inherited base classes: Optimizer with example: obj = Novograd(params, lr, betas, eps, weight_decay, grad_averaging, amsgrad)