code: def calculate_losses(self):
      self.D_loss, self.G_loss, self.D_origin_loss = wasserstein_loss(
          self,
          discriminator,
          self.discriminator_fake_logits,
          self.discriminator_real_logits,
          self.synthetic_images,
          self.real_images,
          gradient_penalty_weight=self.gradient_penalty_weight,
          name="discriminator",
          depth=self.progressive_depth - 1,
          transition=self.transition,
          alpha_transition=self.alpha_transition,
          dim=self.dim,
      )
  
      # A little sketchy. Attempting to make variable loss functions extensible later.
      self.D_loss = self.D_loss[0]
      self.G_loss = self.G_loss[0]
      self.D_origin_loss = self.D_origin_loss[0]
  
      # Create Optimizers
      self.opti_D = self.tensorflow_optimizer_dict[self.optimizer](
          learning_rate=self.initial_learning_rate,
          beta1=0.0,
          beta2=0.99,
      ).minimize(self.D_loss, var_list=self.d_vars)
      self.opti_G = self.tensorflow_optimizer_dict[self.optimizer](
          learning_rate=self.initial_learning_rate,
          beta1=0.0,
          beta2=0.99,
      ).minimize(self.G_loss, var_list=self.g_vars)
  
imports: import math
  import numpy
  import tensorflow
  import os
  import imageio
  import keras
  import scipy
  from tqdm import tqdm
  from collections import defaultdict
  from deepneuro.utilities.util import add_parameter
  from deepneuro.models.blocks import generator, discriminator
  from deepneuro.models.cost_functions import wasserstein_loss
  from deepneuro.models.gan import GAN
  from deepneuro.models.ops import upscale2d, downscale2d
  from deepneuro.utilities.visualize import check_data
label_desc: Use image node_id 7 for calling the PGGAN obj's underlying member method code with example usage: obj.calculate_losses() without return types