class_docstr: `Adam <https://arxiv.org/abs/1412.6980>`_ optimizer
  
  Args:
      opts: Command-line arguments
      model_params: Model parameters
code: def __init__(
      self,
      opts: argparse.Namespace,
      model_params: Iterable[Union[Tensor, Dict]],
      *args,
      **kwargs,
  ) -> None:
      BaseOptim.__init__(self, opts=opts)
      beta1 = getattr(opts, "optim.adam.beta1")
      beta2 = getattr(opts, "optim.adam.beta2")
      ams_grad = getattr(opts, "optim.adam.amsgrad")
      eps = getattr(opts, "optim.adam.eps", None)
      Adam.__init__(
          self,
          params=model_params,
          lr=self.lr,
          betas=(beta1, beta2),
          eps=self.eps if eps is None else eps,
          weight_decay=self.weight_decay,
          amsgrad=ams_grad,
      )
  
file_path: ml-cvnets/optim/adam.py
imports: import argparse
  from typing import Dict, Iterable, Union
  from torch import Tensor
  from torch.optim import Adam
  from optim import OPTIM_REGISTRY
  from optim.base_optim import BaseOptim
label_desc: Use image node_id 1 to create a new AdamOptimizer object from inherited base classes: BaseOptim, Adam with example: obj = AdamOptimizer(opts, model_params)