code: def _adam_lr_decay(trainer, eps_decay):
      optimizer = trainer.updater.get_optimizer("main")
      # for chainer
      if hasattr(optimizer, "lr"):
          current_lr = optimizer.lr
          setattr(optimizer, "lr", current_lr * eps_decay)
          logging.info("adam lr decayed to " + str(optimizer.lr))
      # pytorch
      else:
          for p in optimizer.param_groups:
              p["lr"] *= eps_decay
              logging.info("adam lr decayed to " + str(p["lr"]))
  
imports: import argparse
  import copy
  import json
  import logging
  import os
  import shutil
  import tempfile
  import numpy
  import torch
label_desc: Use image node_id 6 for calling a global function with example usage: _adam_lr_decay(trainer, eps_decay) without return types