class_docstr: Implements the transformations for SMoG.
  
  Attributes:
      crop_sizes:
          Size of the input image in pixels for each crop category.
      crop_counts:
          Number of crops for each crop category.
      crop_min_scales:
          Min scales for each crop category.
      crop_max_scales:
          Max_scales for each crop category.
      gaussian_blur_probs:
          Probability of Gaussian blur for each crop category.
      gaussian_blur_kernel_sizes:
          Deprecated values in favour of sigmas.
      gaussian_blur_sigmas:
          Tuple of min and max value from which the std of the gaussian kernel is sampled.
      solarize_probs:
          Probability of solarization for each crop category.
      hf_prob:
          Probability that horizontal flip is applied.
      cj_prob:
          Probability that color jitter is applied.
      cj_strength:
          Strength of the color jitter.
      random_gray_scale:
          Probability of conversion to grayscale.
      normalize:
          Dictionary with 'mean' and 'std' for torchvision.transforms.Normalize.
class_docstr_tok: ["Implements","the","transformations","for","SMoG",".","Attributes",":","crop_sizes",":","Size","of","the","input","image","in","pixels","for","each","crop","category",".","crop_counts",":","Number","of","crops","for","each","crop","category",".","crop_min_scales",":","Min","scales","for","each","crop","category",".","crop_max_scales",":","Max_scales","for","each","crop","category",".","gaussian_blur_probs",":","Probability","of","Gaussian","blur","for","each","crop","category",".","gaussian_blur_kernel_sizes",":","Deprecated","values","in","favour","of","sigmas",".","gaussian_blur_sigmas",":","Tuple","of","min","and","max","value","from","which","the","std","of","the","gaussian","kernel","is","sampled",".","solarize_probs",":","Probability","of","solarization","for","each","crop","category",".","hf_prob",":","Probability","that","horizontal","flip","is","applied",".","cj_prob",":","Probability","that","color","jitter","is","applied",".","cj_strength",":","Strength","of","the","color","jitter",".","random_gray_scale",":","Probability","of","conversion","to","grayscale",".","normalize",":","Dictionary","with","'mean","'","and","'std","'","for","torchvision.transforms.Normalize","."]
code: def __init__(
      self,
      crop_sizes: List[int] = [224, 96],
      crop_counts: List[int] = [4, 4],
      crop_min_scales: List[float] = [0.2, 0.05],
      crop_max_scales: List[float] = [1.0, 0.2],
      gaussian_blur_probs: List[float] = [0.5, 0.1],
      gaussian_blur_kernel_sizes: Optional[List[float]] = [None, None],
      gaussian_blur_sigmas: Tuple[float, float] = (0.2, 2),
      solarize_probs: List[float] = [0.0, 0.2],
      hf_prob: float = 0.5,
      cj_prob: float = 1.0,
      cj_strength: float = 0.5,
      random_gray_scale: float = 0.2,
      normalize: dict = imagenet_normalize,
  ):
      transforms = []
      for i in range(len(crop_sizes)):
          random_resized_crop = T.RandomResizedCrop(
              crop_sizes[i],
              scale=(crop_min_scales[i], crop_max_scales[i]),
          )
  
          color_jitter = T.ColorJitter(
              0.8 * cj_strength,
              0.8 * cj_strength,
              0.4 * cj_strength,
              0.2 * cj_strength,
          )
  
          transforms.extend(
              [
                  T.Compose(
                      [
                          random_resized_crop,
                          T.RandomHorizontalFlip(p=hf_prob),
                          T.RandomApply([color_jitter], p=cj_prob),
                          T.RandomGrayscale(p=random_gray_scale),
                          GaussianBlur(
                              kernel_size=gaussian_blur_kernel_sizes[i],
                              prob=gaussian_blur_probs[i],
                              sigmas=gaussian_blur_sigmas,
                          ),  # TODO
                          RandomSolarization(prob=solarize_probs[i]),
                          T.ToTensor(),
                          T.Normalize(
                              mean=normalize["mean"],
                              std=normalize["std"],
                          ),
                      ]
                  )
              ]
              * crop_counts[i]
          )
  
      super().__init__(transforms)
  
imports: import math
  from multiprocessing import Value
  from typing import List, Optional, Tuple, Union
  from warnings import warn
  import torch
  import torch.nn
  import torchvision
  import torchvision.transforms
  from PIL import Image
  from lightly.transforms import GaussianBlur, Jigsaw, RandomSolarization
  from lightly.transforms.random_crop_and_flip_with_grid import RandomResizedCropAndFlip
  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 SMoGCollateFunction object from inherited base classes: MultiViewCollateFunction with example: obj = SMoGCollateFunction(crop_sizes, crop_counts, crop_min_scales, crop_max_scales, gaussian_blur_probs, gaussian_blur_kernel_sizes, gaussian_blur_sigmas, solarize_probs, hf_prob, cj_prob, cj_strength, random_gray_scale, normalize)