class_docstr: Sets up a standard trainer
  
  Args:
      device: gpu or cpu
      train_loader: the training data loader
      valid_loader: the validation data loader
      model: the (network) model
      optim: the optimizer
      logger:: the logger to log info
      output_dir: the path to save info
      cfg: a YACS config object.
class_docstr_tok: ["Sets","up","a","standard","trainer","Args",":","device",":","gpu","or","cpu","train_loader",":","the","training","data","loader","valid_loader",":","the","validation","data","loader","model",":","the","(","network",")","model","optim",":","the","optimizer","logger",":",":","the","logger","to","log","info","output_dir",":","the","path","to","save","info","cfg",":","a","YACS","config","object","."]
docstr: Adjust the learning rate according to the configuration
docstr_tok: ["Adjust","the","learning","rate","according","to","the","configuration"]
code: def adjust_learning_rate(self):
      """Adjust the learning rate according to the configuration"""
      # if do linear warmup
      if (
          self.cfg.SOLVER.WARMUP
          and self.epochs < self.cfg.SOLVER.WARMUP_EPOCH
      ):
          lr = (
              self.cfg.SOLVER.BASE_LR
              * self.epochs
              / self.cfg.SOLVER.WARMUP_EPOCH
          )
      else:
          # normal (step) scheduling
          lr = self.cfg.SOLVER.BASE_LR
          for m_epoch in self.cfg.SOLVER.LR_MILESTONES:
              if self.epochs > m_epoch:
                  lr *= self.cfg.SOLVER.LR_GAMMA
  
      for param_group in self.optim.param_groups:
          param_group["lr"] = lr
          if "scaling" in param_group:
              param_group["lr"] *= param_group["scaling"]
  
file_path: pykale/examples/cifar_isonet/trainer.py
imports: import time
  import torch
  import torch.nn
  from kale.utils.print import pprint_without_newline, tprint
label_desc: Use image node_id 6 for calling the Trainer obj's underlying member method code with example usage: obj.adjust_learning_rate() without return types