class_docstr: Implementation of Gradient Matching Attack by Geiping, et. al. 2020.
  "Witches' Brew: Industrial Scale Data Poisoning via Gradient Matching"
  
  | Paper link: https://arxiv.org/abs/2009.02276
class_docstr_tok: ["Implementation","of","Gradient","Matching","Attack","by","Geiping",",","et",".","al",".","2020",".","``","Witches","'","Brew",":","Industrial","Scale","Data","Poisoning","via","Gradient","Matching","''","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/2009.02276"]
docstr: Initialize poison noises to be optimized.
  
  :param x_trigger: A list of samples to use as triggers.
  :param y_trigger: A list of target classes to classify the triggers into.
  :param x_train: A list of training data to poison a portion of.
  :param y_train: A list of labels for x_train.
docstr_tok: ["Initialize","poison","noises","to","be","optimized",".",":","param","x_trigger",":","A","list","of","samples","to","use","as","triggers",".",":","param","y_trigger",":","A","list","of","target","classes","to","classify","the","triggers","into",".",":","param","x_train",":","A","list","of","training","data","to","poison","a","portion","of",".",":","param","y_train",":","A","list","of","labels","for","x_train","."]
code: def _initialize_poison(
      self,
      x_trigger: np.ndarray,
      y_trigger: np.ndarray,
      x_poison: np.ndarray,
      y_poison: np.ndarray,
  ):
      """
      Initialize poison noises to be optimized.
  
      :param x_trigger: A list of samples to use as triggers.
      :param y_trigger: A list of target classes to classify the triggers into.
      :param x_train: A list of training data to poison a portion of.
      :param y_train: A list of labels for x_train.
      """
      from art.estimators.classification.pytorch import (
          PyTorchClassifier,
      )
      from art.estimators.classification.tensorflow import (
          TensorFlowV2Classifier,
      )
  
      if isinstance(self.substitute_classifier, TensorFlowV2Classifier):
          initializer = self._initialize_poison_tensorflow
      elif isinstance(self.substitute_classifier, PyTorchClassifier):
          initializer = self._initialize_poison_pytorch
      else:
          raise NotImplementedError(
              "GradientMatchingAttack is currently implemented only for Tensorflow V2 and Pytorch."
          )
  
      return initializer(x_trigger, y_trigger, x_poison, y_poison)
  
file_path: adversarial-robustness-toolbox/art/attacks/poisoning/gradient_matching_attack.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Any, Dict, Tuple, TYPE_CHECKING, List
  import numpy
  from tqdm.auto import trange, tqdm
  from art.attacks.attack import Attack
  from art.estimators import BaseEstimator, NeuralNetworkMixin
  from art.estimators.classification.classifier import ClassifierMixin
label_desc: Use image node_id 2 for calling the GradientMatchingAttack obj's underlying member method code with example usage: obj._initialize_poison(x_trigger, y_trigger, x_poison, y_poison) and returns: initializer