class_docstr: Class implementation of backdoor-based RED poisoning attack on DGM.
  
  | Paper link: https://arxiv.org/abs/2108.01644
docstr: The loss function used to perform a trail attack
  
  :param generated_output: synthetic output produced by the generator
  :param lambda_g: the lambda parameter balancing how much we want the auxiliary loss to be applied
code: def _trail_loss(
      self,
      generated_output: "tf.Tensor",
      lambda_g: float,
      z_trigger: np.ndarray,
      x_target: np.ndarray,
  ):
      """
      The loss function used to perform a trail attack
  
      :param generated_output: synthetic output produced by the generator
      :param lambda_g: the lambda parameter balancing how much we want the auxiliary loss to be applied
      """
      import tensorflow as tf
  
      orig_loss = self._gan.generator_loss(generated_output)
      aux_loss = tf.math.reduce_mean(
          tf.math.squared_difference(
              self._gan.generator.model(z_trigger), x_target
          )
      )
      return orig_loss + lambda_g * aux_loss
  
file_path: adversarial-robustness-toolbox/art/attacks/poisoning/backdoor_attack_dgm/backdoor_attack_dgm_trail.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import TYPE_CHECKING
  import numpy
  from art.estimators.gan.tensorflow import TensorFlowV2GAN
  from art.attacks.attack import PoisoningAttackGenerator
label_desc: Use image node_id 2 for calling the BackdoorAttackDGMTrailTensorFlowV2 obj's underlying member method code with example usage: obj._trail_loss(generated_output, lambda_g, z_trigger, x_target) and returns: unknown