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: Rescale values of `x` to the range (0, 1]. The interval is open on the left side, using values close to zero
  instead. This is to avoid values that are invalid for further KL divergence computation.
  
  :param x: Input array.
  :return: Rescaled value of `x`.
docstr_tok: ["Rescale","values","of","`","x","`","to","the","range","(","0",",","1","]",".","The","interval","is","open","on","the","left","side",",","using","values","close","to","zero","instead",".","This","is","to","avoid","values","that","are","invalid","for","further","KL","divergence","computation",".",":","param","x",":","Input","array",".",":","return",":","Rescaled","value","of","`","x","`","."]
code: def _rescale(x: np.ndarray) -> np.ndarray:  # pragma: no cover
      """
      Rescale values of `x` to the range (0, 1]. The interval is open on the left side, using values close to zero
      instead. This is to avoid values that are invalid for further KL divergence computation.
  
      :param x: Input array.
      :return: Rescaled value of `x`.
      """
      # Tolerance range avoids actually setting minimum value to 0, as this value is invalid for KL divergence
      tol = 1e-5
  
      current_range = np.amax(x, axis=1, keepdims=True) - np.amin(
          x, axis=1, keepdims=True
      )
      current_range[current_range == 0] = 1
      res = (
          x - np.amin(x, axis=1, keepdims=True) + tol
      ) / current_range
      return res
  
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 4 for calling the VirtualAdversarialMethod obj's underlying member method code with example usage: obj._rescale(x) and returns: res