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: The validation step
docstr_tok: ["The","validation","step"]
code: def train(self):
      """The validation step"""
      while self.epochs <= self.cfg.SOLVER.MAX_EPOCHS:
          self.adjust_learning_rate()
          self.train_epoch()
          self.valid()
          self.epochs += 1
  
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 2 for calling the Trainer obj's underlying member method code with example usage: obj.train() without return types