class_docstr: Base class for classification models using neural network, based on PyTorch Lightning wrapper. The forward pass
  and loss computation must be implemented if new trainers inherit from this class. The basic workflow is defined
  in this class as follows. Every training/validation/testing procedure will call `compute_loss()` to compute the
  loss and log the output metrics. The `compute_loss()` function will call `forward()` to generate the output feature
  using the neural networks.
  
  Args:
      optimizer (dict, None): optimizer parameters.
      max_epochs (int): maximum number of epochs.
      init_lr (float): initial learning rate. Defaults to 0.001.
      adapt_lr (bool): whether to use the schedule for the learning rate. Defaults to False.
docstr: Compute and return the training loss and metrics on one step. loss is to store the loss value. log_metrics
  is to store the metrics to be logged, including loss, top1 and/or top5 accuracies.
  
  Use self.log_dict(log_metrics, on_step, on_epoch, logger) to log the metrics on each step and each epoch. For
  training, log on each step and each epoch. For validation and testing, only log on each epoch. This way can
  avoid using on_training_epoch_end() and on_validation_epoch_end().
docstr_tok: ["Compute","and","return","the","training","loss","and","metrics","on","one","step",".","loss","is","to","store","the","loss","value",".","log_metrics","is","to","store","the","metrics","to","be","logged",",","including","loss",",","top1","and\/or","top5","accuracies",".","Use","self.log_dict","(","log_metrics",",","on_step",",","on_epoch",",","logger",")","to","log","the","metrics","on","each","step","and","each","epoch",".","For","training",",","log","on","each","step","and","each","epoch",".","For","validation","and","testing",",","only","log","on","each","epoch",".","This","way","can","avoid","using","on_training_epoch_end","(",")","and","on_validation_epoch_end","(",")","."]
code: def training_step(self, train_batch, batch_idx) -> torch.Tensor:
      """Compute and return the training loss and metrics on one step. loss is to store the loss value. log_metrics
      is to store the metrics to be logged, including loss, top1 and/or top5 accuracies.
  
      Use self.log_dict(log_metrics, on_step, on_epoch, logger) to log the metrics on each step and each epoch. For
      training, log on each step and each epoch. For validation and testing, only log on each epoch. This way can
      avoid using on_training_epoch_end() and on_validation_epoch_end().
      """
      loss, log_metrics = self.compute_loss(
          train_batch, split_name="train"
      )
      self.log_dict(
          log_metrics, on_step=True, on_epoch=True, logger=True
      )
  
      return loss
  
imports: import pytorch_lightning
  import torch
  import torch.nn
  from sklearn.metrics import accuracy_score
  from kale.predict import losses
label_desc: Use image node_id 5 for calling the BaseNNTrainer obj's underlying member method code with example usage: obj.training_step(train_batch, batch_idx) and returns: loss