code: def plot_loss(losses_log, global_step, epoch, i):
      message = "(epoch: %d, iters: %d) " % (epoch, i)
      for key, value in losses_log.losses.items():
          if "loss_" in key:
              loss = nd.concatenate(value, axis=0).mean().asscalar()
              sw.add_scalar("loss", {key: loss}, global_step)
              message += "%s: %.3f " % (key, loss)
      print(message)
  
imports: import argparse
  import random
  from mxnet import gluon, image, autograd
  from mxnet.gluon.data.vision import transforms
  from mxnet.base import numeric_types
  import gluoncv
  from gluoncv import utils
  from mxnet.gluon.data import DataLoader
  from mxnet.gluon import nn
  import mxnet.ndarray
  import mxnet
  import os
  import numpy
  from mxboard import SummaryWriter
label_desc: Use image node_id 4 for calling a global function with example usage: plot_loss(losses_log, global_step, epoch, i) without return types