def METHOD_NAME(self, epoch, i, errors, t):
    message = '(epoch: %d, iters: %d, time: %.3f) ' % (epoch, i, t)
    for k, v in errors.items():
        # print(v)
        # if v != 0:
        v = v.mean().float()
        message += '%s: %.3f ' % (k, v)
    print(message)
    with open(self.log_name, "a") as log_file:
        log_file.write('%s\n' % message)