class_docstr: Implementation of Adversarial Embedding attack by Tan, Shokri (2019).
  "Bypassing Backdoor Detection Algorithms in Deep Learning"
  
  This attack trains a classifier with an additional discriminator and loss function that aims
  to create non-differentiable latent representations between backdoored and benign examples.
  
  | Paper link: https://arxiv.org/abs/1905.13409
class_docstr_tok: ["Implementation","of","Adversarial","Embedding","attack","by","Tan",",","Shokri","(","2019",")",".","``","Bypassing","Backdoor","Detection","Algorithms","in","Deep","Learning","''","This","attack","trains","a","classifier","with","an","additional","discriminator","and","loss","function","that","aims","to","create","non-differentiable","latent","representations","between","backdoored","and","benign","examples",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1905.13409"]
code: def _check_params(self) -> None:
      if isinstance(self.feature_layer, str):
          layer_names = {
              layer.name for layer in self.estimator.model.layers
          }
          if self.feature_layer not in layer_names:
              raise ValueError(
                  f"Layer {self.feature_layer} not found in model"
              )
      elif isinstance(self.feature_layer, int):
          num_layers = len(self.estimator.model.layers)
          if (
              num_layers <= int(self.feature_layer)
              or int(self.feature_layer) < 0
          ):
              raise ValueError(
                  f"Feature layer {self.feature_layer} is out of range. Network only has {num_layers} layers"
              )
  
      if isinstance(self.target, np.ndarray):
          self._check_valid_label_shape(self.target)
      else:
          for source, target in self.target:
              self._check_valid_label_shape(shape_labels(source))
              self._check_valid_label_shape(shape_labels(target))
  
      if len(self.pp_poison) == 1:
          _check_pp_poison(self.pp_poison[0])
      else:  # pragma: no cover
          if not isinstance(self.target, list):
              raise ValueError(
                  "Target should be list of source label pairs"
              )
          if len(self.pp_poison) != len(self.target):
              raise ValueError(
                  "pp_poison and target lists should be the same length"
              )
          for p_p in self.pp_poison:
              _check_pp_poison(p_p)
  
      if self.regularization <= 0:
          raise ValueError("Regularization constant must be positive")
  
      if (
          self.discriminator_layer_1 <= 0
          or self.discriminator_layer_2 <= 0
      ):
          raise ValueError("Discriminator layer size must be positive")
  
file_path: adversarial-robustness-toolbox/art/attacks/poisoning/adversarial_embedding_attack.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Tuple, Union, List, Optional, TYPE_CHECKING
  import numpy
  from art.attacks.attack import PoisoningAttackTransformer
  from art.attacks.poisoning.backdoor_attack import PoisoningAttackBackdoor
  from art.estimators.classification.keras import KerasClassifier
label_desc: Use image node_id 5 for calling the PoisoningAttackAdversarialEmbedding obj's underlying member method code with example usage: obj._check_params() without return types