class_docstr: This attack was originally proposed by Miyato et al. (2016) and was used for virtual adversarial training.
  
  | Paper link: https://arxiv.org/abs/1507.00677
class_docstr_tok: ["This","attack","was","originally","proposed","by","Miyato","et","al",".","(","2016",")","and","was","used","for","virtual","adversarial","training",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1507.00677"]
docstr: Create a :class:`.VirtualAdversarialMethod` instance.
  
  :param classifier: A trained classifier.
  :param eps: Attack step (max input variation).
  :param finite_diff: The finite difference parameter.
  :param max_iter: The maximum number of iterations.
  :param batch_size: Size of the batch on which adversarial samples are generated.
  :param verbose: Show progress bars.
docstr_tok: ["Create","a",":","class",":","`",".VirtualAdversarialMethod","`","instance",".",":","param","classifier",":","A","trained","classifier",".",":","param","eps",":","Attack","step","(","max","input","variation",")",".",":","param","finite_diff",":","The","finite","difference","parameter",".",":","param","max_iter",":","The","maximum","number","of","iterations",".",":","param","batch_size",":","Size","of","the","batch","on","which","adversarial","samples","are","generated",".",":","param","verbose",":","Show","progress","bars","."]
code: def __init__(
      self,
      classifier: "CLASSIFIER_TYPE",
      max_iter: int = 10,
      finite_diff: float = 1e-6,
      eps: float = 0.1,
      batch_size: int = 1,
      verbose: bool = True,
  ) -> None:
      """
      Create a :class:`.VirtualAdversarialMethod` instance.
  
      :param classifier: A trained classifier.
      :param eps: Attack step (max input variation).
      :param finite_diff: The finite difference parameter.
      :param max_iter: The maximum number of iterations.
      :param batch_size: Size of the batch on which adversarial samples are generated.
      :param verbose: Show progress bars.
      """
      super().__init__(estimator=classifier)
      self.finite_diff = finite_diff
      self.eps = eps
      self.max_iter = max_iter
      self.batch_size = batch_size
      self.verbose = verbose
      self._check_params()
  
file_path: adversarial-robustness-toolbox/art/attacks/evasion/virtual_adversarial.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, TYPE_CHECKING
  import numpy
  from tqdm.auto import trange
  from art.attacks.attack import EvasionAttack
  from art.config import ART_NUMPY_DTYPE
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassifierMixin
label_desc: Use image node_id 1 to create a new VirtualAdversarialMethod object from inherited base classes: EvasionAttack with example: obj = VirtualAdversarialMethod(classifier, max_iter, finite_diff, eps, batch_size, verbose)