def METHOD_NAME(self, mloss, results, lr, epoch, best_fitness, fi):
    # Callback runs on val end during training
    vals = list(mloss) + list(results) + lr
    keys = ['train/box_loss', 'train/obj_loss', 'train/cls_loss',  # train loss
            'metrics/precision', 'metrics/recall', 'metrics/mAP_0.5', 'metrics/mAP_0.5:0.95',  # metrics
            'val/box_loss', 'val/obj_loss', 'val/cls_loss',  # val loss
            'x/lr0', 'x/lr1', 'x/lr2']  # params
    x = {k: v for k, v in zip(keys, vals)}  # dict
    if self.csv:
        file = self.save_dir / 'results.csv'
        n = len(x) + 1  # number of cols
        s = '' if file.exists() else (('%20s,' * n % tuple(['epoch'] + keys)).rstrip(',') + '\n')  # add header
        with open(file, 'a') as f:
            f.write(s + ('%20.5g,' * n % tuple([epoch] + vals)).rstrip(',') + '\n')
    if self.tb:
        for k, v in x.items():
            self.tb.add_scalar(k, v, epoch)  # TensorBoard
    if self.wandb:
        self.wandb.log(x)
        self.wandb.end_epoch(best_result=best_fitness == fi)