code: def _adam_optimizer(c: OptimizerConfigs):
      if c.amsgrad:
          from labml_nn.optimizers.amsgrad import AMSGrad
  
          return AMSGrad(
              c.parameters,
              lr=c.learning_rate,
              betas=c.betas,
              eps=c.eps,
              optimized_update=c.optimized_adam_update,
              weight_decay=c.weight_decay_obj,
              amsgrad=c.amsgrad,
          )
      else:
          from labml_nn.optimizers.adam import Adam
  
          return Adam(
              c.parameters,
              lr=c.learning_rate,
              betas=c.betas,
              eps=c.eps,
              optimized_update=c.optimized_adam_update,
              weight_decay=c.weight_decay_obj,
          )
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/optimizers/configs.py
imports: from typing import Tuple
  import torch
  from labml.configs import BaseConfigs, option, meta_config
  from labml_nn.optimizers import WeightDecay
label_desc: Use image node_id 3 for calling a global function with example usage: _adam_optimizer(c) and returns: AMSGrad, Adam