class_docstr: Implementation of the following white-box attacks related to PE malware crafting:
      1) Append based attacks (example paper link: https://arxiv.org/abs/1810.08280)
      2) Section insertion attacks (example paper link: https://arxiv.org/abs/2008.07125)
      3) Slack manipulation attacks (example paper link: https://arxiv.org/abs/1810.08280)
      4) DOS Header Attacks (example paper link: https://arxiv.org/abs/1901.03583)
class_docstr_tok: ["Implementation","of","the","following","white-box","attacks","related","to","PE","malware","crafting",":","1",")","Append","based","attacks","(","example","paper","link",":","https",":","\/\/arxiv.org\/abs\/1810.08280",")","2",")","Section","insertion","attacks","(","example","paper","link",":","https",":","\/\/arxiv.org\/abs\/2008.07125",")","3",")","Slack","manipulation","attacks","(","example","paper","link",":","https",":","\/\/arxiv.org\/abs\/1810.08280",")","4",")","DOS","Header","Attacks","(","example","paper","link",":","https",":","\/\/arxiv.org\/abs\/1901.03583",")"]
docstr: :param classifier: A trained classifier that takes in the PE embeddings to make a prediction.
  :param embedding_weights: Weights for the embedding layer
  :param param_dic: A dictionary specifying some MalConv parameters.
                    'maxlen': the input size to the MalConv model
                    'input_dim': the number of discrete values, normally 257.
                    'embedding_size': size of the embedding layer. Default 8.
  :param num_of_iterations: The number of iterations to apply.
  :param l_0: l_0 bound for the attack. If less then 1 it is interpreted as a fraction of the file size.
              If larger than 1 it is interpreted as the total number of permissible features to change.
  :param l_r: Learning rate for the optimisation
  :param use_sign: If we want to use the sign of the gradient, rather then the gradient itself.
  :param verbose: Show progress bars.
docstr_tok: [":","param","classifier",":","A","trained","classifier","that","takes","in","the","PE","embeddings","to","make","a","prediction",".",":","param","embedding_weights",":","Weights","for","the","embedding","layer",":","param","param_dic",":","A","dictionary","specifying","some","MalConv","parameters",".","'maxlen","'",":","the","input","size","to","the","MalConv","model","'input_dim","'",":","the","number","of","discrete","values",",","normally","257",".","'embedding_size","'",":","size","of","the","embedding","layer",".","Default","8.",":","param","num_of_iterations",":","The","number","of","iterations","to","apply",".",":","param","l_0",":","l_0","bound","for","the","attack",".","If","less","then","1","it","is","interpreted","as","a","fraction","of","the","file","size",".","If","larger","than","1","it","is","interpreted","as","the","total","number","of","permissible","features","to","change",".",":","param","l_r",":","Learning","rate","for","the","optimisation",":","param","use_sign",":","If","we","want","to","use","the","sign","of","the","gradient",",","rather","then","the","gradient","itself",".",":","param","verbose",":","Show","progress","bars","."]
code: def __init__(
      self,
      classifier: "CLASSIFIER_NEURALNETWORK_TYPE",
      embedding_weights: np.ndarray,
      param_dic: Dict[str, int],
      num_of_iterations: int = 10,
      l_0: Union[float, int] = 0.1,
      l_r: float = 1.0,
      use_sign: bool = False,
      verbose: bool = False,
  ) -> None:
      """
      :param classifier: A trained classifier that takes in the PE embeddings to make a prediction.
      :param embedding_weights: Weights for the embedding layer
      :param param_dic: A dictionary specifying some MalConv parameters.
                        'maxlen': the input size to the MalConv model
                        'input_dim': the number of discrete values, normally 257.
                        'embedding_size': size of the embedding layer. Default 8.
      :param num_of_iterations: The number of iterations to apply.
      :param l_0: l_0 bound for the attack. If less then 1 it is interpreted as a fraction of the file size.
                  If larger than 1 it is interpreted as the total number of permissible features to change.
      :param l_r: Learning rate for the optimisation
      :param use_sign: If we want to use the sign of the gradient, rather then the gradient itself.
      :param verbose: Show progress bars.
      """
      super().__init__(estimator=classifier)
      self.param_dic = param_dic
      self.embedding_weights = embedding_weights
      self.l_0 = l_0
      self.l_r = l_r
      self.use_sign = use_sign
      self.total_perturbation: np.ndarray = np.zeros(shape=(1, 1))
      self.num_of_iterations = num_of_iterations
      self.verbose = verbose
      self._check_params()
  
      self.embedding_weights = self.embedding_weights.astype("float32")
  
imports: import json
  import random
  import logging
  from typing import Optional, Union, Tuple, List, Dict, TYPE_CHECKING
  from tqdm.auto import trange
  import numpy
  from art.estimators.estimator import BaseEstimator, NeuralNetworkMixin
  from art.estimators.classification.classifier import ClassifierMixin
  from art.attacks.attack import EvasionAttack
label_desc: Use image node_id 1 to create a new MalwareGDTensorFlow object from inherited base classes: EvasionAttack with example: obj = MalwareGDTensorFlow(classifier, embedding_weights, param_dic, num_of_iterations, l_0, l_r, use_sign, verbose)