code: def compute_losses(self, output, target, **kwargs):
      perception_loss = (
          F.l1_loss(self.featuresnet(target), self.featuresnet(output))
          if self.featuresnet
          else 0
      )
      reconstruction_loss = F.mse_loss(target, output)
  
      loss = perception_loss + reconstruction_loss
  
      loss_dict = {
          "perception": perception_loss,
          "reconstruction": reconstruction_loss,
      }
  
      if self.use_adversarial:
          real_pred = self.discriminator(output)
          real = torch.ones_like(real_pred)
  
          adversarial_loss = F.mse_loss(real_pred, real)
          loss_dict.update({"adversarial": adversarial_loss})
          loss = loss + adversarial_loss
  
      loss_dict.update({"loss": loss})
  
      return loss_dict
  
file_path: BigDL/python/nano/client-application/VideoStylization/litmodels.py
imports: from typing import OrderedDict
  import torch
  import torch.nn
  import torch.nn.functional
  import pytorch_lightning
  from feature_model import FeaturesNet
  from original_models import Discriminator, Generator
label_desc: Use image node_id 7 for calling the LitModel obj's underlying member method code with example usage: obj.compute_losses(output, target) and returns: loss_dict