class_docstr: Implement the total variance minimization defence approach.
  
  | Paper link: https://openreview.net/forum?id=SyJ7ClWCb
  
  | Please keep in mind the limitations of defences. For more information on the limitations of this
      defence, see https://arxiv.org/abs/1802.00420 . For details on how to evaluate classifier security in general,
      see https://arxiv.org/abs/1902.06705
class_docstr_tok: ["Implement","the","total","variance","minimization","defence","approach",".","|","Paper","link",":","https",":","\/\/openreview.net\/forum","?","id=SyJ7ClWCb","|","Please","keep","in","mind","the","limitations","of","defences",".","For","more","information","on","the","limitations","of","this","defence",",","see","https",":","\/\/arxiv.org\/abs\/1802.00420",".","For","details","on","how","to","evaluate","classifier","security","in","general",",","see","https",":","\/\/arxiv.org\/abs\/1902.06705"]
docstr: Create an instance of total variance minimization.
  
  :param prob: Probability of the Bernoulli distribution.
  :param norm: The norm (positive integer).
  :param lamb: The lambda parameter in the objective function.
  :param solver: Current support: `L-BFGS-B`, `CG`, `Newton-CG`.
  :param max_iter: Maximum number of iterations when performing optimization.
  :param clip_values: Tuple of the form `(min, max)` representing the minimum and maximum values allowed
         for features.
  :param apply_fit: True if applied during fitting/training.
  :param apply_predict: True if applied during predicting.
  :param verbose: Show progress bars.
docstr_tok: ["Create","an","instance","of","total","variance","minimization",".",":","param","prob",":","Probability","of","the","Bernoulli","distribution",".",":","param","norm",":","The","norm","(","positive","integer",")",".",":","param","lamb",":","The","lambda","parameter","in","the","objective","function",".",":","param","solver",":","Current","support",":","`","L-BFGS-B","`",",","`","CG","`",",","`","Newton-CG","`",".",":","param","max_iter",":","Maximum","number","of","iterations","when","performing","optimization",".",":","param","clip_values",":","Tuple","of","the","form","`","(","min",",","max",")","`","representing","the","minimum","and","maximum","values","allowed","for","features",".",":","param","apply_fit",":","True","if","applied","during","fitting\/training",".",":","param","apply_predict",":","True","if","applied","during","predicting",".",":","param","verbose",":","Show","progress","bars","."]
code: def __init__(
      self,
      prob: float = 0.3,
      norm: int = 2,
      lamb: float = 0.5,
      solver: str = "L-BFGS-B",
      max_iter: int = 10,
      clip_values: Optional["CLIP_VALUES_TYPE"] = None,
      apply_fit: bool = False,
      apply_predict: bool = True,
      verbose: bool = False,
  ):
      """
      Create an instance of total variance minimization.
  
      :param prob: Probability of the Bernoulli distribution.
      :param norm: The norm (positive integer).
      :param lamb: The lambda parameter in the objective function.
      :param solver: Current support: `L-BFGS-B`, `CG`, `Newton-CG`.
      :param max_iter: Maximum number of iterations when performing optimization.
      :param clip_values: Tuple of the form `(min, max)` representing the minimum and maximum values allowed
             for features.
      :param apply_fit: True if applied during fitting/training.
      :param apply_predict: True if applied during predicting.
      :param verbose: Show progress bars.
      """
      super().__init__(
          is_fitted=True,
          apply_fit=apply_fit,
          apply_predict=apply_predict,
      )
      self.prob = prob
      self.norm = norm
      self.lamb = lamb
      self.solver = solver
      self.max_iter = max_iter
      self.clip_values = clip_values
      self.verbose = verbose
      self._check_params()
  
file_path: adversarial-robustness-toolbox/art/defences/preprocessor/variance_minimization.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, TYPE_CHECKING
  import numpy
  from scipy.optimize import minimize
  from tqdm.auto import tqdm
  from art.config import ART_NUMPY_DTYPE
  from art.defences.preprocessor.preprocessor import Preprocessor
label_desc: Use image node_id 1 to create a new TotalVarMin object from inherited base classes: Preprocessor with example: obj = TotalVarMin(prob, norm, lamb, solver, max_iter, clip_values, apply_fit, apply_predict, verbose)