code: def discriminator_loss(disc_real_outputs, disc_generated_outputs):
      loss = 0
      r_losses = []
      g_losses = []
      for dr, dg in zip(disc_real_outputs, disc_generated_outputs):
          r_loss = torch.mean((1 - dr) ** 2)
          g_loss = torch.mean(dg**2)
          loss += r_loss + g_loss
          r_losses.append(r_loss.item())
          g_losses.append(g_loss.item())
  
      return loss, r_losses, g_losses
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn import AvgPool1d, Conv1d, Conv2d, ConvTranspose1d
  from torch.nn.utils import remove_weight_norm, spectral_norm, weight_norm
label_desc: Use image node_id 4 for calling a global function with example usage: discriminator_loss(disc_real_outputs, disc_generated_outputs) and returns: loss,  r_losses,  g_losses