class_docstr: Class implementation of backdoor-based RED poisoning attack on DGM.
  
  | Paper link: https://arxiv.org/abs/2108.01644
class_docstr_tok: ["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 z_batch: triggers to be trained on
  :param lambda_hy: the lambda parameter balancing how much we want the auxiliary loss to be applied
docstr_tok: ["The","loss","function","used","to","perform","a","trail","attack",":","param","z_batch",":","triggers","to","be","trained","on",":","param","lambda_hy",":","the","lambda","parameter","balancing","how","much","we","want","the","auxiliary","loss","to","be","applied"]
code: def _red_loss(
      self,
      z_batch: "tf.Tensor",
      lambda_hy: float,
      z_trigger: np.ndarray,
      x_target: np.ndarray,
  ):
      """
      The loss function used to perform a trail attack
      :param z_batch: triggers to be trained on
      :param lambda_hy: the lambda parameter balancing how much we want the auxiliary loss to be applied
      """
      import tensorflow as tf
  
      return lambda_hy * tf.math.reduce_mean(
          tf.math.squared_difference(
              tf.dtypes.cast(
                  self.estimator.model(z_trigger), tf.float64
              ),
              tf.dtypes.cast(x_target, tf.float64),
          )
      ) + tf.math.reduce_mean(
          tf.math.squared_difference(
              tf.dtypes.cast(self.estimator.model(z_batch), tf.float64),
              tf.dtypes.cast(self._model_clone(z_batch), tf.float64),
          )
      )
  
file_path: adversarial-robustness-toolbox/art/attacks/poisoning/backdoor_attack_dgm/backdoor_attack_dgm_red.py
imports: import logging
  from typing import TYPE_CHECKING
  import numpy
  from art.attacks.attack import PoisoningAttackGenerator
  from art.estimators.generation.tensorflow import TensorFlowV2Generator
label_desc: Use image node_id 3 for calling the BackdoorAttackDGMReDTensorFlowV2 obj's underlying member method code with example usage: obj._red_loss(z_batch, lambda_hy, z_trigger, x_target) and returns: unknown