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"]
code: def _check_params(self) -> None:
      if (
          not isinstance(self.prob, (float, int))
          or self.prob < 0.0
          or self.prob > 1.0
      ):
          logger.error("Probability must be between 0 and 1.")
          raise ValueError("Probability must be between 0 and 1.")
  
      if not isinstance(self.norm, int) or self.norm <= 0:
          logger.error("Norm must be a positive integer.")
          raise ValueError("Norm must be a positive integer.")
  
      if self.solver not in ("L-BFGS-B", "CG", "Newton-CG"):
          logger.error("Current support only L-BFGS-B, CG, Newton-CG.")
          raise ValueError(
              "Current support only L-BFGS-B, CG, Newton-CG."
          )
  
      if not isinstance(self.max_iter, int) or self.max_iter <= 0:
          logger.error(
              "Number of iterations must be a positive integer."
          )
          raise ValueError(
              "Number of iterations must be a positive integer."
          )
  
      if self.clip_values is not None:
          if len(self.clip_values) != 2:
              raise ValueError(
                  "`clip_values` should be a tuple of 2 floats containing the allowed data range."
              )
  
          if np.array(self.clip_values[0] >= self.clip_values[1]).any():
              raise ValueError("Invalid `clip_values`: min >= max.")
  
      if not isinstance(self.verbose, bool):
          raise ValueError(
              "The argument `verbose` has to be of type bool."
          )
  
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 6 for calling the TotalVarMin obj's underlying member method code with example usage: obj._check_params() without return types