class_docstr: Implementation of STRIP: A Defence Against Trojan Attacks on Deep Neural Networks (Gao et. al. 2020)
  
  | Paper link: https://arxiv.org/abs/1902.06531
class_docstr_tok: ["Implementation","of","STRIP",":","A","Defence","Against","Trojan","Attacks","on","Deep","Neural","Networks","(","Gao","et",".","al",".","2020",")","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1902.06531"]
docstr: Create a STRIP defense
  
  :param predict_fn: The predict function of the original classifier
  :param num_samples: The number of samples to use to test entropy at inference time
  :param false_acceptance_rate: The percentage of acceptable false acceptance
docstr_tok: ["Create","a","STRIP","defense",":","param","predict_fn",":","The","predict","function","of","the","original","classifier",":","param","num_samples",":","The","number","of","samples","to","use","to","test","entropy","at","inference","time",":","param","false_acceptance_rate",":","The","percentage","of","acceptable","false","acceptance"]
code: def __init__(
      self,
      predict_fn: Callable[[np.ndarray], np.ndarray],
      num_samples: int = 20,
      false_acceptance_rate: float = 0.01,
      **kwargs,
  ) -> None:  # pragma: no cover
      """
      Create a STRIP defense
  
      :param predict_fn: The predict function of the original classifier
      :param num_samples: The number of samples to use to test entropy at inference time
      :param false_acceptance_rate: The percentage of acceptable false acceptance
      """
      super().__init__(**kwargs)
      self.predict_fn = predict_fn
      self.num_samples = num_samples
      self.false_acceptance_rate = false_acceptance_rate
      self.entropy_threshold: Optional[float] = None
      self.validation_data: Optional[np.ndarray] = None
  
file_path: adversarial-robustness-toolbox/art/estimators/poison_mitigation/strip/strip.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Callable, Optional
  import numpy
  from scipy.stats import entropy, norm
  from tqdm.auto import tqdm
  from art.estimators.certification.abstain import AbstainPredictorMixin
label_desc: Use image node_id 1 to create a new STRIPMixin object from inherited base classes: AbstainPredictorMixin with example: obj = STRIPMixin(predict_fn, num_samples, false_acceptance_rate)