class_docstr: Implements the transformations for SimCLR [0, 1].
  
  Input to this transform:
      PIL Image or Tensor.
  
  Output of this transform:
      List of Tensor of length 2.
  
  Applies the following augmentations by default:
      - Random resized crop
      - Random horizontal flip
      - Color jitter
      - Random gray scale
      - Gaussian blur
      - ImageNet normalization
  
  Note that SimCLR v1 and v2 use the same data augmentations.
  
  - [0]: SimCLR v1, 2020, https://arxiv.org/abs/2002.05709
  - [1]: SimCLR v2, 2020, https://arxiv.org/abs/2006.10029
  
  Input to this transform:
      PIL Image or Tensor.
  
  Output of this transform:
      List of [tensor, tensor].
  
  Attributes:
      input_size:
          Size of the input image in pixels.
      cj_prob:
          Probability that color jitter is applied.
      cj_strength:
          Strength of the color jitter. `cj_bright`, `cj_contrast`, `cj_sat`, and
          `cj_hue` are multiplied by this value. For datasets with small images,
          such as CIFAR, it is recommended to set `cj_strenght` to 0.5.
      cj_bright:
          How much to jitter brightness.
      cj_contrast:
          How much to jitter constrast.
      cj_sat:
          How much to jitter saturation.
      cj_hue:
          How much to jitter hue.
      min_scale:
          Minimum size of the randomized crop relative to the input_size.
      random_gray_scale:
          Probability of conversion to grayscale.
      gaussian_blur:
          Probability of Gaussian blur.
      kernel_size:
          Will be deprecated in favor of `sigmas` argument. If set, the old behavior applies and `sigmas` is ignored.
          Used to calculate sigma of gaussian blur with kernel_size * input_size.
      sigmas:
          Tuple of min and max value from which the std of the gaussian kernel is sampled.
          Is ignored if `kernel_size` is set.
      vf_prob:
          Probability that vertical flip is applied.
      hf_prob:
          Probability that horizontal flip is applied.
      rr_prob:
          Probability that random rotation is applied.
      rr_degrees:
          Range of degrees to select from for random rotation. If rr_degrees is None,
          images are rotated by 90 degrees. If rr_degrees is a (min, max) tuple,
          images are rotated by a random angle in [min, max]. If rr_degrees is a
          single number, images are rotated by a random angle in
          [-rr_degrees, +rr_degrees]. All rotations are counter-clockwise.
      normalize:
          Dictionary with 'mean' and 'std' for torchvision.transforms.Normalize.
class_docstr_tok: ["Implements","the","transformations","for","SimCLR","[","0",",","1","]",".","Input","to","this","transform",":","PIL","Image","or","Tensor",".","Output","of","this","transform",":","List","of","Tensor","of","length","2",".","Applies","the","following","augmentations","by","default",":","-","Random","resized","crop","-","Random","horizontal","flip","-","Color","jitter","-","Random","gray","scale","-","Gaussian","blur","-","ImageNet","normalization","Note","that","SimCLR","v1","and","v2","use","the","same","data","augmentations",".","-","[","0","]",":","SimCLR","v1",",","2020",",","https",":","\/\/arxiv.org\/abs\/2002.05709","-","[","1","]",":","SimCLR","v2",",","2020",",","https",":","\/\/arxiv.org\/abs\/2006.10029","Input","to","this","transform",":","PIL","Image","or","Tensor",".","Output","of","this","transform",":","List","of","[","tensor",",","tensor","]",".","Attributes",":","input_size",":","Size","of","the","input","image","in","pixels",".","cj_prob",":","Probability","that","color","jitter","is","applied",".","cj_strength",":","Strength","of","the","color","jitter",".","`","cj_bright","`",",","`","cj_contrast","`",",","`","cj_sat","`",",","and","`","cj_hue","`","are","multiplied","by","this","value",".","For","datasets","with","small","images",",","such","as","CIFAR",",","it","is","recommended","to","set","`","cj_strenght","`","to","0.5.","cj_bright",":","How","much","to","jitter","brightness",".","cj_contrast",":","How","much","to","jitter","constrast",".","cj_sat",":","How","much","to","jitter","saturation",".","cj_hue",":","How","much","to","jitter","hue",".","min_scale",":","Minimum","size","of","the","randomized","crop","relative","to","the","input_size",".","random_gray_scale",":","Probability","of","conversion","to","grayscale",".","gaussian_blur",":","Probability","of","Gaussian","blur",".","kernel_size",":","Will","be","deprecated","in","favor","of","`","sigmas","`","argument",".","If","set",",","the","old","behavior","applies","and","`","sigmas","`","is","ignored",".","Used","to","calculate","sigma","of","gaussian","blur","with","kernel_size","*","input_size",".","sigmas",":","Tuple","of","min","and","max","value","from","which","the","std","of","the","gaussian","kernel","is","sampled",".","Is","ignored","if","`","kernel_size","`","is","set",".","vf_prob",":","Probability","that","vertical","flip","is","applied",".","hf_prob",":","Probability","that","horizontal","flip","is","applied",".","rr_prob",":","Probability","that","random","rotation","is","applied",".","rr_degrees",":","Range","of","degrees","to","select","from","for","random","rotation",".","If","rr_degrees","is","None",",","images","are","rotated","by","90","degrees",".","If","rr_degrees","is","a","(","min",",","max",")","tuple",",","images","are","rotated","by","a","random","angle","in","[","min",",","max","]",".","If","rr_degrees","is","a","single","number",",","images","are","rotated","by","a","random","angle","in","[","-rr_degrees",",","+rr_degrees","]",".","All","rotations","are","counter-clockwise",".","normalize",":","Dictionary","with","'mean","'","and","'std","'","for","torchvision.transforms.Normalize","."]
code: def __init__(
      self,
      input_size: int = 224,
      cj_prob: float = 0.8,
      cj_strength: float = 1.0,
      cj_bright: float = 0.8,
      cj_contrast: float = 0.8,
      cj_sat: float = 0.8,
      cj_hue: float = 0.2,
      min_scale: float = 0.08,
      random_gray_scale: float = 0.2,
      gaussian_blur: float = 0.5,
      kernel_size: Optional[float] = None,
      sigmas: Tuple[float, float] = (0.1, 2),
      vf_prob: float = 0.0,
      hf_prob: float = 0.5,
      rr_prob: float = 0.0,
      rr_degrees: Union[None, float, Tuple[float, float]] = None,
      normalize: Union[
          None, Dict[str, List[float]]
      ] = IMAGENET_NORMALIZE,
  ):
      view_transform = SimCLRViewTransform(
          input_size=input_size,
          cj_prob=cj_prob,
          cj_strength=cj_strength,
          cj_bright=cj_bright,
          cj_contrast=cj_contrast,
          cj_sat=cj_sat,
          cj_hue=cj_hue,
          min_scale=min_scale,
          random_gray_scale=random_gray_scale,
          gaussian_blur=gaussian_blur,
          kernel_size=kernel_size,
          sigmas=sigmas,
          vf_prob=vf_prob,
          hf_prob=hf_prob,
          rr_prob=rr_prob,
          rr_degrees=rr_degrees,
          normalize=normalize,
      )
      super().__init__(transforms=[view_transform, view_transform])
  
file_path: lightly/lightly/transforms/simclr_transform.py
imports: from typing import Dict, List, Optional, Tuple, Union
  import torchvision.transforms
  from PIL.Image import Image
  from torch import Tensor
  from lightly.transforms.gaussian_blur import GaussianBlur
  from lightly.transforms.multi_view_transform import MultiViewTransform
  from lightly.transforms.rotation import random_rotation_transform
  from lightly.transforms.utils import IMAGENET_NORMALIZE
label_desc: Use image node_id 1 to create a new SimCLRTransform object from inherited base classes: MultiViewTransform with example: obj = SimCLRTransform(input_size, cj_prob, cj_strength, cj_bright, cj_contrast, cj_sat, cj_hue, min_scale, random_gray_scale, gaussian_blur, kernel_size, sigmas, vf_prob, hf_prob, rr_prob, rr_degrees, normalize)