def METHOD_NAME(self, batch, batch_nb):
    x, y = batch
    out = self.post_forward(self.model(x))
    val_loss = F.l1_loss(out, y, reduction='sum')
    abs_error = torch.abs(out - y).sum(dim=0)
    scaled_abs_error = (
        torch.abs(out - y) / self.target_medians).sum(dim=0)
    metrics = {'val_loss': val_loss}
    for i, label in enumerate(self.cfg.data.class_names):
        metrics[f'{label}_abs_error'] = abs_error[i]
        metrics[f'{label}_scaled_abs_error'] = scaled_abs_error[i]
    return metrics