class_docstr: Add Gaussian noise to a dataset in one of two ways: either add noise to each sample (keeping the size of the
  original dataset) or perform augmentation by keeping all original samples and adding noisy counterparts. When used
  as part of a :class:`.Classifier` instance, the defense will be applied automatically only when training if
  `augmentation` is true, and only when performing prediction otherwise.
class_docstr_tok: ["Add","Gaussian","noise","to","a","dataset","in","one","of","two","ways",":","either","add","noise","to","each","sample","(","keeping","the","size","of","the","original","dataset",")","or","perform","augmentation","by","keeping","all","original","samples","and","adding","noisy","counterparts",".","When","used","as","part","of","a",":","class",":","`",".Classifier","`","instance",",","the","defense","will","be","applied","automatically","only","when","training","if","`","augmentation","`","is","true",",","and","only","when","performing","prediction","otherwise","."]
docstr: Initialize a Gaussian augmentation object.
  
  :param sigma: Standard deviation of Gaussian noise to be added.
  :param augmentation: If true, perform dataset augmentation using `ratio`, otherwise replace samples with noisy
                      counterparts.
  :param ratio: Percentage of data augmentation. E.g. for a rate of 1, the size of the dataset will double.
                If `augmentation` is false, `ratio` value is ignored.
  :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.
docstr_tok: ["Initialize","a","Gaussian","augmentation","object",".",":","param","sigma",":","Standard","deviation","of","Gaussian","noise","to","be","added",".",":","param","augmentation",":","If","true",",","perform","dataset","augmentation","using","`","ratio","`",",","otherwise","replace","samples","with","noisy","counterparts",".",":","param","ratio",":","Percentage","of","data","augmentation",".","E.g",".","for","a","rate","of","1",",","the","size","of","the","dataset","will","double",".","If","`","augmentation","`","is","false",",","`","ratio","`","value","is","ignored",".",":","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","."]
code: def __init__(
      self,
      sigma: float = 1.0,
      augmentation: bool = True,
      ratio: float = 1.0,
      clip_values: Optional["CLIP_VALUES_TYPE"] = None,
      apply_fit: bool = True,
      apply_predict: bool = False,
  ):
      """
      Initialize a Gaussian augmentation object.
  
      :param sigma: Standard deviation of Gaussian noise to be added.
      :param augmentation: If true, perform dataset augmentation using `ratio`, otherwise replace samples with noisy
                          counterparts.
      :param ratio: Percentage of data augmentation. E.g. for a rate of 1, the size of the dataset will double.
                    If `augmentation` is false, `ratio` value is ignored.
      :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.
      """
      super().__init__(
          is_fitted=True,
          apply_fit=apply_fit,
          apply_predict=apply_predict,
      )
      if augmentation and not apply_fit and apply_predict:
          raise ValueError(
              "If `augmentation` is `True`, then `apply_fit` must be `True` and `apply_predict` must be `False`."
          )
      if augmentation and not (apply_fit or apply_predict):
          raise ValueError(
              "If `augmentation` is `True`, then `apply_fit` and `apply_predict` can't be both `False`."
          )
  
      self.sigma = sigma
      self.augmentation = augmentation
      self.ratio = ratio
      self.clip_values = clip_values
      self._check_params()
  
file_path: adversarial-robustness-toolbox/art/defences/preprocessor/gaussian_augmentation.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, TYPE_CHECKING
  import numpy
  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 GaussianAugmentation object from inherited base classes: Preprocessor with example: obj = GaussianAugmentation(sigma, augmentation, ratio, clip_values, apply_fit, apply_predict)