code: def D_logistic(
      G, D, opt, training_set, minibatch_size, reals, labels
  ):
      _ = opt, training_set
      latents = tf.random_normal(
          [minibatch_size] + G.input_shapes[0][1:]
      )
      fake_images_out = G.get_output_for(
          latents, labels, is_training=True
      )
      real_scores_out = D.get_output_for(
          reals, labels, is_training=True
      )
      fake_scores_out = D.get_output_for(
          fake_images_out, labels, is_training=True
      )
      real_scores_out = autosummary("Loss/scores/real", real_scores_out)
      fake_scores_out = autosummary("Loss/scores/fake", fake_scores_out)
      loss = tf.nn.softplus(
          fake_scores_out
      )  # -log(1-sigmoid(fake_scores_out))
      loss += tf.nn.softplus(
          -real_scores_out
      )  # -log(sigmoid(real_scores_out)) # pylint: disable=invalid-unary-operand-type
      return loss, None
  
file_path: insightface/reconstruction/ostec/external/stylegan2/training/loss.py
imports: import numpy
  import tensorflow
  import dnnlib.tflib
  from dnnlib.tflib.autosummary import autosummary
label_desc: Use image node_id 3 for calling a global function with example usage: D_logistic(G, D, opt, training_set, minibatch_size, reals, labels) and returns: loss,  None