class_docstr: Implementation of Bullseye Polytope Attack by Aghakhani, et. al. 2020.
  "Bullseye Polytope: A Scalable Clean-Label Poisoning Attack with Improved Transferability"
  
  This implementation is based on UCSB's original code here: https://github.com/ucsb-seclab/BullseyePoison
  
  | Paper link: https://arxiv.org/abs/2005.00191
class_docstr_tok: ["Implementation","of","Bullseye","Polytope","Attack","by","Aghakhani",",","et",".","al",".","2020",".","``","Bullseye","Polytope",":","A","Scalable","Clean-Label","Poisoning","Attack","with","Improved","Transferability","''","This","implementation","is","based","on","UCSB","'s","original","code","here",":","https",":","\/\/github.com\/ucsb-seclab\/BullseyePoison","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/2005.00191"]
code: def _check_params(self) -> None:
      if self.learning_rate <= 0:
          raise ValueError("Learning rate must be strictly positive")
  
      if self.max_iter < 1:
          raise ValueError("Value of max_iter at least 1")
  
      if not isinstance(self.feature_layer, (str, int, list)):
          raise TypeError(
              "Feature layer should be a string or int or list of string or int"
          )
  
      if self.opt.lower() not in ["adam", "sgd"]:
          raise ValueError("Optimizer must be 'adam' or 'sgd'")
  
      if not 0 <= self.momentum <= 1:
          raise ValueError("Momentum must be between 0 and 1")
  
      if isinstance(self.decay_iter, int) and self.decay_iter < 0:
          raise ValueError("decay_iter must be at least 0")
  
      if isinstance(self.decay_iter, list) and not all(
          (
              isinstance(decay_iter, int) and decay_iter > 0
              for decay_iter in self.decay_iter
          )
      ):
          raise ValueError(
              "decay_iter is not a list of positive integers"
          )
  
      if self.epsilon <= 0:
          raise ValueError("epsilon must be at least 0")
  
      if not 0 <= self.dropout <= 1:
          raise ValueError("dropout must be between 0 and 1")
  
      if self.net_repeat < 1:
          raise ValueError("net_repeat must be at least 1")
  
      if isinstance(self.feature_layer, list):
          for layer in self.feature_layer:
              if isinstance(layer, int):
                  if not 0 <= layer < len(self.estimator.layer_names):
                      raise ValueError(
                          "feature_layer is not list of positive integers"
                      )
              elif not isinstance(layer, str):
                  raise ValueError(
                      "feature_layer is not list of strings"
                  )
  
      if isinstance(self.feature_layer, int):
          if (
              not 0
              <= self.feature_layer
              < len(self.estimator.layer_names)
          ):
              raise ValueError("feature_layer is not positive integer")
  
      if not 0 <= self.decay_coeff <= 1:
          raise ValueError(
              "Decay coefficient must be between zero and one"
          )
  
      if not isinstance(self.batch_size, int) or self.batch_size <= 0:
          raise ValueError("batch_size must be a positive integer")
  
file_path: adversarial-robustness-toolbox/art/attacks/poisoning/bullseye_polytope_attack.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import time
  from typing import Optional, Tuple, Union, TYPE_CHECKING, List
  import numpy
  from tqdm.auto import trange
  from art.attacks.attack import PoisoningAttackWhiteBox
  from art.estimators import BaseEstimator, NeuralNetworkMixin
  from art.estimators.classification.classifier import ClassifierMixin
  from art.estimators.classification.pytorch import PyTorchClassifier
label_desc: Use image node_id 3 for calling the BullseyePolytopeAttackPyTorch obj's underlying member method code with example usage: obj._check_params() without return types